From 26502eafb534df07565e644cfb522070b7e61d9c Mon Sep 17 00:00:00 2001 From: pavelhov Date: Wed, 21 Oct 2026 11:59:29 -0400 Subject: [PATCH 1/2] fix: restore Grok OAuth requests with current client version --- docs-site/src/content/docs/guides/providers.md | 6 ++++++ src/providers/xai-transport.ts | 6 ++++-- tests/xai-transport.test.ts | 12 ++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs-site/src/content/docs/guides/providers.md b/docs-site/src/content/docs/guides/providers.md index ba0b757ad21..b538c6a0dbd 100644 --- a/docs-site/src/content/docs/guides/providers.md +++ b/docs-site/src/content/docs/guides/providers.md @@ -115,6 +115,12 @@ ccx logout | `cursor` | `cursor` | `https://api2.cursor.sh` | Experimental unofficial PKCE login **or** a pasted dashboard user API key. Same unofficial AgentService/Run protocol either way; not a public OpenAI chat-completions API. | | `github-copilot` | `openai-chat` | `https://api.githubcopilot.com` | Experimental. GitHub device flow + `copilot_internal` exchange (VS Code OAuth client). Requires an active Copilot subscription; not an official third-party API. | +If an xAI OAuth request to the Grok subscription proxy reports that the Grok CLI client version is +outdated, update CodexCommander to a release with the current xAI compatibility profile. Routed +requests advertise CodexCommander's pinned client version; they do not launch the local `grok` +executable, so updating that executable alone does not change the request fingerprint. xAI API-key +requests use `api.x.ai` and do not use the Grok subscription-proxy fingerprint. + For the canonical Kimi Coding Plan presets (`kimi` account login and `kimi-code` API key), CodexCommander forwards only a caller-supplied stable `prompt_cache_key` to the Chat Completions request; it never generates one. Kimi documents a stable session/task key as required to improve Code Plan diff --git a/src/providers/xai-transport.ts b/src/providers/xai-transport.ts index 6e527b94d77..a1a459e0b93 100644 --- a/src/providers/xai-transport.ts +++ b/src/providers/xai-transport.ts @@ -4,9 +4,11 @@ import { resolveGithubCopilotTransport } from "./github-copilot-transport"; export const XAI_GROK_CLI_BASE_URL = "https://cli-chat-proxy.grok.com/v1"; +const XAI_GROK_COMPATIBILITY_VERSION = "1.0.52"; + export const XAI_GROK_COMPATIBILITY = { - version: "0.2.93", - userAgent: "codexcommander-grok/0.2.93", + version: XAI_GROK_COMPATIBILITY_VERSION, + userAgent: `codexcommander-grok/${XAI_GROK_COMPATIBILITY_VERSION}`, headers: { clientIdentifier: "x-grok-client-identifier", clientVersion: "x-grok-client-version", diff --git a/tests/xai-transport.test.ts b/tests/xai-transport.test.ts index ac41c015731..bb1af094bd7 100644 --- a/tests/xai-transport.test.ts +++ b/tests/xai-transport.test.ts @@ -356,6 +356,18 @@ describe("xAI outbound compatibility headers", () => { test("OAuth snapshot is exact", async () => { const { effective, seen } = await capture("oauth"); expect(effective.baseUrl).toBe(XAI_GROK_CLI_BASE_URL); + // Keep this literal independent of the imported profile constant so a stale + // fingerprint cannot make both implementation and expectation pass together. + const outgoingVersion = seen[0]!.get("x-grok-client-version")!; + expect(XAI_GROK_CLIENT_VERSION).toBe("1.0.52"); + expect(outgoingVersion).toBe("1.0.52"); + expect(seen[0]!.get("user-agent")).toBe(`codexcommander-grok/${outgoingVersion}`); + const actual = outgoingVersion.split(".").map(Number); + const minimum = [1, 0, 13]; + const atLeastMinimum = actual[0]! > minimum[0]! + || (actual[0] === minimum[0] && actual[1]! > minimum[1]!) + || (actual[0] === minimum[0] && actual[1] === minimum[1] && actual[2]! >= minimum[2]!); + expect(atLeastMinimum).toBe(true); expect(lower(seen[0])).toEqual({ authorization: "Bearer oauth-token", "content-type": "application/json", From 6dffbc1fd9b50e7c75a23e16259b6ee93b534e1a Mon Sep 17 00:00:00 2001 From: pavelhov Date: Wed, 21 Oct 2026 12:00:33 -0400 Subject: [PATCH 2/2] chore(release): prepare 0.1.21 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 068e0f6ded5..5fdc7c73493 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codexcommander", - "version": "0.1.20", + "version": "0.1.21", "private": true, "description": "CodexCommander — universal provider proxy for OpenAI Codex & Claude Code — use any LLM with Codex CLI/App/SDK and Claude Code", "type": "module",