Repository navigation
grok-cli returns 426 for every request: xAI now rejects Grok CLI 0.2.106 - #12
TechNickAI wants to merge 1 commit into
Conversation
…h 426 xAI's cli-chat-proxy began returning 426 on 2026-09-30: Your Grok CLI version (0.2.106) is outdated. Please update to version 1.0.13 or later Default bumped to 1.0.46, the current stable @xai-official/grok, captured off the wire from the signed binary (User-Agent: grok-shell/1.0.46 (<os>; <arch>)). Adds GROK_CLI_CLIENT_VERSION env override (semver-validated) so the next floor bump is an .env edit plus restart, matching CODEX_CLIENT_VERSION.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3605700c34
ℹ️ 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".
| ); | ||
| assert.equal(grokCli.config.tokenUrl, "https://auth.x.ai/oauth2/token"); | ||
| assert.equal(getGrokBuildClientVersion(), "0.2.106"); | ||
| assert.equal(getGrokBuildClientVersion(), GROK_BUILD_DEFAULT_CLIENT_VERSION); |
There was a problem hiding this comment.
Clear the version override before asserting the default
When GROK_CLI_CLIENT_VERSION is set—the supported deployment configuration introduced by this commit—this assertion compares the overridden runtime value against the default constant and fails (for example, 1.0.99 versus 1.0.46). Unlike the new version-specific tests, this test does not isolate or clear the environment variable, so developers or CI jobs running the suite with the override enabled get a false failure; unset the variable around this assertion or make the expectation account for it.
Useful? React with 👍 / 👎.
Symptom
Every
grok-cli/*request returns HTTP 426 from xAI's cli-chat-proxy:First 426 in our call log: 2026-10-01T23:49:22Z. With grok-cli rung 1 dead, the
grokcombo fell through toopenrouter/~x-ai/grok-latest, which resolves to Grok 4.7, the version Nick had rolled back.Fix
GROK_BUILD_DEFAULT_CLIENT_VERSION0.2.106 -> 1.0.46, the current stable@xai-official/grok. Captured off the wire from the signed darwin-arm64 binary:User-Agent: grok-shell/1.0.46 (macos; aarch64). The UA format is unchanged, only the version moves.GROK_CLI_CLIENT_VERSIONenv override, semver-validated, read per call. The next floor bump is an.envedit plus restart, the same asCODEX_CLIENT_VERSION. Malformed values (CRLF, spaces,latest) fall back to the default instead of going out in a header.Upstream
Upstream v3.8.51+ already ships
1.0.41, but with no env override. This branch is based on our deployed486509c7, so it is the minimal delta to deploy now. Drop this commit at the next rebase if upstream adds an override. If not, keep only the env-override half.Tests
tests/unit/grok-cli-client-version.test.ts(new, 3 tests). Counterfactuals: reverting the default to 0.2.106 fails test 1, removing the env read fails tests 2 and 3, removing validation fails test 3.