Skip to content

grok-cli returns 426 for every request: xAI now rejects Grok CLI 0.2.106 - #12

Open
TechNickAI wants to merge 1 commit into
nick/upgrade-v3.8.51-rebase-20260922from
fix/grok-cli-client-version-1.0.46
Open

TechNickAI wants to merge 1 commit into
nick/upgrade-v3.8.51-rebase-20260922from
fix/grok-cli-client-version-1.0.46

Conversation

@TechNickAI

Copy link
Copy Markdown
Owner

Symptom

Every grok-cli/* request returns HTTP 426 from xAI's cli-chat-proxy:

Your Grok CLI version (0.2.106) is outdated. Please update to version 1.0.13 or later

First 426 in our call log: 2026-10-01T23:49:22Z. With grok-cli rung 1 dead, the grok combo fell through to openrouter/~x-ai/grok-latest, which resolves to Grok 4.7, the version Nick had rolled back.

Fix

  • GROK_BUILD_DEFAULT_CLIENT_VERSION 0.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.
  • New GROK_CLI_CLIENT_VERSION env override, semver-validated, read per call. The next floor bump is an .env edit plus restart, the same as CODEX_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 deployed 486509c7, 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.
  • All 251 grok tests pass.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T00:38:06.335072Z 3605700 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 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);

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 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 👍 / 👎.

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