Skip to content

docs: add provider selection guide and FAQ (#2300)#2305

Open
cy2311 wants to merge 1 commit into
Hmbown:mainfrom
cy2311:docs/provider-selection-guide
Open

docs: add provider selection guide and FAQ (#2300)#2305
cy2311 wants to merge 1 commit into
Hmbown:mainfrom
cy2311:docs/provider-selection-guide

Conversation

@cy2311
Copy link
Copy Markdown

@cy2311 cy2311 commented May 28, 2026

Closes #2300

Adds a "How to Choose a Provider" section and FAQ to PROVIDERS.md.

Key clarifications:

  • vLLM vs OpenAI: use vllm only for vLLM engine; use openai for any other OpenAI-compatible gateway
  • OpenAI Responses API: not supported (Chat Completions only)
  • Multiple providers: supported via config, switch with /provider at runtime
  • Tool calling: all providers support OpenAI-compatible tool call payloads

Greptile Summary

This PR adds a Windows .bat launcher that prefers Windows Terminal and generates it as part of the release asset preparation, with a corresponding entry added to ASSET_MATRIX in artifacts.js.

  • .bat launcher generation (prepare-local-release-assets.js): the new if (isWindows) block writes codewhale.bat, hashes it, and appends it to the checksum manifest — but set NO_ANIMATIONS=1 is placed after the binary is launched in both branches, so the environment variable is never present when the process starts.
  • ASSET_MATRIX update (artifacts.js): codewhale.bat is added as a third element to the win32/x64 pair, but allAssetNames() (and therefore allReleaseAssetNames()) only iterates pair[0] and pair[1], meaning codewhale.bat is excluded from release-asset verification even though it appears in the checksum manifest.

Confidence Score: 2/5

Not safe to merge as-is: the .bat launcher's NO_ANIMATIONS variable is set after the binary runs (making it a no-op), and codewhale.bat is invisible to the release-verification path due to the fixed-arity assumption in allAssetNames().

Two concrete defects in the changed code: the env-var ordering means Windows Terminal users never get the intended NO_ANIMATIONS=1 behavior, and the allAssetNames() function's hard-coded pair[0]/pair[1] indexing silently drops codewhale.bat from release verification on every run.

Both changed files need attention: prepare-local-release-assets.js for the set ordering, and artifacts.js for the incomplete iteration in allAssetNames().

Important Files Changed

Filename Overview
scripts/release/prepare-local-release-assets.js Adds Windows .bat launcher generation with a Windows Terminal preference check, but set NO_ANIMATIONS=1 is placed after the binary is invoked in both branches, so the env var is never seen by the process.
npm/codewhale/scripts/artifacts.js Adds codewhale.bat as a third element to the win32/x64 asset pair, but allAssetNames() and detectBinaryNames() only read pair[0]/pair[1], so the entry is invisible to release verification and install logic.

Sequence Diagram

sequenceDiagram
    participant User
    participant codewhale.bat
    participant wt as Windows Terminal (wt)
    participant cmd as cmd /k
    participant exe as codewhale-windows-x64.exe

    User->>codewhale.bat: double-click / invoke
    codewhale.bat->>codewhale.bat: where wt
    alt wt found
        codewhale.bat->>wt: wt --title CodeWhale cmd /k exe
        wt->>cmd: spawn cmd /k
        cmd->>exe: run exe
        Note over codewhale.bat: set NO_ANIMATIONS=1 (too late)
    else wt not found
        codewhale.bat->>exe: run exe (blocks)
        exe-->>codewhale.bat: exits
        Note over codewhale.bat: set NO_ANIMATIONS=1 (too late)
    end
Loading

Comments Outside Diff (1)

  1. npm/codewhale/scripts/artifacts.js, line 111-119 (link)

    P1 allAssetNames() hard-codes pair[0] and pair[1], so codewhale.bat (now pair[2] of the win32/x64 entry) is silently omitted from the returned set. As a result, allReleaseAssetNames() also excludes it, meaning verify-release-assets.js (line 118) never checks whether codewhale.bat was actually published to the GitHub release, even though the checksum manifest will contain its hash. Either extend the loop to pair[2] when it exists, or keep the .bat out of ASSET_MATRIX entirely and treat it as a purely generated artifact.

    Fix in Codex Fix in Claude Code Fix in Cursor

Fix All in Codex Fix All in Claude Code Fix All in Cursor

Reviews (1): Last reviewed commit: "fix: Windows .bat launcher with correct ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a Windows batch launcher (codewhale.bat) that prefers Windows Terminal when executing the application. The review feedback highlights several critical issues: the environment variable NO_ANIMATIONS is set too late in the batch script, using cmd /k keeps the terminal window open unnecessarily, and guarding the generation with isWindows prevents packaging on non-Windows CI runners. Additionally, adding codewhale.bat to ASSET_MATRIX is redundant and potentially problematic, as the file is already manually generated and added to the manifest.

Comment on lines +66 to +84
if (isWindows) {
const batContent = [
"@echo off",
"where wt >nul 2>nul",
'if "%ERRORLEVEL%"=="0" (',
' wt --title CodeWhale cmd /k "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
") else (",
' "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
")",
"",
].join("\r\n");
const batPath = path.join(outputDir, "codewhale.bat");
await fs.writeFile(batPath, batContent, "utf8");
const batHash = await sha256(batPath);
manifestLines.push(`${batHash} codewhale.bat`);
console.log(`Generated ${batPath}`);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There are three issues with the current batch file generation:

  1. Environment Variable Timing: set NO_ANIMATIONS=1 is executed after the executable is launched. Since running a console application blocks the batch script, and launching wt spawns a separate process immediately, the environment variable is never inherited by the running codewhale process. It should be set at the top of the batch file.
  2. Terminal Window Persistence: Using cmd /k keeps the command prompt window open after codewhale exits. Changing this to cmd /c ensures the window closes automatically when the application terminates.
  3. Cross-Platform Release Preparation: Guarding the generation with if (isWindows) means that when preparing all assets on a non-Windows CI runner (e.g., Linux CI with prepareAllAssets enabled), codewhale.bat will not be generated or included in the checksum manifest. Changing the guard to if (isWindows || prepareAllAssets) ensures the batch file is always packaged correctly.
  if (isWindows || prepareAllAssets) {
    const batContent = [
      "@echo off",
      "set NO_ANIMATIONS=1",
      "where wt >nul 2>nul",
      'if "%ERRORLEVEL%"=="0" (',
      '    wt --title CodeWhale cmd /c "%~dp0codewhale-windows-x64.exe"',
      ") else (",
      '    "%~dp0codewhale-windows-x64.exe"',
      ")",
      "",
    ].join("\r\n");
    const batPath = path.join(outputDir, "codewhale.bat");
    await fs.writeFile(batPath, batContent, "utf8");
    const batHash = await sha256(batPath);
    manifestLines.push(batHash + "  codewhale.bat");
    console.log("Generated " + batPath);
  }

Comment on lines 15 to 17
win32: {
x64: ["codewhale-windows-x64.exe", "codewhale-tui-windows-x64.exe"],
x64: ["codewhale-windows-x64.exe", "codewhale-tui-windows-x64.exe", "codewhale.bat"],
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding "codewhale.bat" to ASSET_MATRIX has no functional effect because allAssetNames() and detectBinaryNames() only reference index 0 and 1 of the asset array. Furthermore, if allAssetNames() were updated to include all elements, it would cause prepare-local-release-assets.js (when prepareAllAssets is enabled) to incorrectly copy the compiled codewhale.exe binary onto codewhale.bat. Since codewhale.bat is already manually generated and added to the manifest in prepare-local-release-assets.js, it should be removed from ASSET_MATRIX to avoid confusion and potential bugs.

Suggested change
win32: {
x64: ["codewhale-windows-x64.exe", "codewhale-tui-windows-x64.exe"],
x64: ["codewhale-windows-x64.exe", "codewhale-tui-windows-x64.exe", "codewhale.bat"],
},
win32: {
x64: ["codewhale-windows-x64.exe", "codewhale-tui-windows-x64.exe"],
},

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 244fd739b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +71 to +74
' wt --title CodeWhale cmd /k "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
") else (",
' "%~dp0codewhale-windows-x64.exe"',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Forward batch-file arguments to the launcher

When users run the generated Windows launcher with any arguments, such as codewhale.bat --version or a command prompt, these lines invoke the executable without %*, so the batch file silently drops every argument. This only affects users launching through the new .bat asset, but it makes that launcher behave differently from invoking codewhale-windows-x64.exe directly.

Useful? React with 👍 / 👎.

Comment on lines +71 to +75
' wt --title CodeWhale cmd /k "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
") else (",
' "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Set NO_ANIMATIONS before starting CodeWhale

In both branches the executable is started before NO_ANIMATIONS is set, so the child process never sees the variable; in the wt case the new terminal is launched with the old environment, and in the fallback case cmd waits for the exe to exit before setting it. This means the generated launcher does not actually force the intended accessibility mode for Windows users.

Useful? React with 👍 / 👎.

},
win32: {
x64: ["codewhale-windows-x64.exe", "codewhale-tui-windows-x64.exe"],
x64: ["codewhale-windows-x64.exe", "codewhale-tui-windows-x64.exe", "codewhale.bat"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include codewhale.bat in the generated release asset list

Adding codewhale.bat as a third entry here does not make it part of allAssetNames() or allReleaseAssetNames(), because that helper only pushes pair[0] and pair[1]. I checked the release workflow: it publishes downloaded build artifacts and generates the manifest from those files, while the new batch file is only created by the local prepare script on Windows, so release:check/prepublishOnly still will not require or verify this asset.

Useful? React with 👍 / 👎.

Comment on lines +67 to +78
const batContent = [
"@echo off",
"where wt >nul 2>nul",
'if "%ERRORLEVEL%"=="0" (',
' wt --title CodeWhale cmd /k "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
") else (",
' "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
")",
"",
].join("\r\n");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 set NO_ANIMATIONS=1 is placed after the binary is launched in both branches, so the environment variable is never visible to the process. In the else branch the .exe runs synchronously to completion before set executes; in the wt branch, wt spawns a new terminal window immediately and returns, so set only mutates the current bat session's environment — it does not propagate into the already-started cmd /k child. Moving the set before the branch is the correct fix.

Suggested change
const batContent = [
"@echo off",
"where wt >nul 2>nul",
'if "%ERRORLEVEL%"=="0" (',
' wt --title CodeWhale cmd /k "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
") else (",
' "%~dp0codewhale-windows-x64.exe"',
" set NO_ANIMATIONS=1",
")",
"",
].join("\r\n");
const batContent = [
"@echo off",
"set NO_ANIMATIONS=1",
"where wt >nul 2>nul",
'if "%ERRORLEVEL%"=="0" (',
' wt --title CodeWhale cmd /k "%~dp0codewhale-windows-x64.exe"',
") else (",
' "%~dp0codewhale-windows-x64.exe"',
")",
"",
].join("\r\n");

Fix in Codex Fix in Claude Code Fix in Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

兼容多模型支持

1 participant