Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/providers/xai-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function isXaiResponsesDestination(provider: Pick<OcxProviderConfig, "bas
}

export const XAI_GROK_COMPATIBILITY = {
version: "0.2.93",
userAgent: "opencodex-grok/0.2.93",
version: "1.0.25",

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 Badge Pin the accepted Grok client version independently

Add a focused regression that independently asserts the reported version is at least the upstream-required 1.0.13 floor (or pins the supported 1.0.25 profile). The existing assertions in tests/providers/xai/xai-transport.test.ts and the quota tests derive their expectations from XAI_GROK_CLIENT_VERSION, so they passed with 0.2.93 and still pass after this edit; reverting or downgrading the constant would therefore recreate the OAuth-wide HTTP 426 failure without making the suite red.

AGENTS.md reference: AGENTS.md:L448-L452

Useful? React with 👍 / 👎.

userAgent: "opencodex-grok/1.0.25",
Comment on lines +31 to +32

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 Badge Document the new Grok compatibility floor

Update the owned structure documentation for this transport change. structure/providers/xai-grok.md currently records only that a single compatibility-profile constant exists, but not the newly load-bearing 1.0.13 upstream floor or the 1.0.25 profile reported here; without that update, the source-owner documentation omits the invariant whose violation disables every OAuth request.

AGENTS.md reference: src/AGENTS.md:L11-L11

Useful? React with 👍 / 👎.

headers: {
clientIdentifier: "x-grok-client-identifier",
clientVersion: "x-grok-client-version",
Expand Down
8 changes: 4 additions & 4 deletions tests/providers/xai/xai-transport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,16 +533,16 @@ async function capture(authMode: "oauth" | "key", calls = 1) {
}

describe("xAI outbound compatibility headers", () => {
test("OAuth snapshot is exact", async () => {
test("OAuth snapshot pins Grok CLI compatibility to 1.0.25", async () => {
const { effective, seen } = await capture("oauth");
expect(effective.baseUrl).toBe(XAI_GROK_CLI_BASE_URL);
expect(lower(seen[0])).toEqual({
authorization: "Bearer oauth-token",
"content-type": "application/json",
"user-agent": `opencodex-grok/${XAI_GROK_CLIENT_VERSION}`,
"user-agent": "opencodex-grok/1.0.25",
"x-authenticateresponse": "authenticate-response",
"x-grok-client-identifier": "opencodex",
"x-grok-client-version": XAI_GROK_CLIENT_VERSION,
"x-grok-client-version": "1.0.25",
"x-grok-conv-id": deriveXaiConvId("codex-session-abc"),
"x-grok-req-id": expect.stringMatching(UUID_V4),
"x-grok-session-id": deriveXaiConvId("codex-session-abc"),
Expand All @@ -557,7 +557,7 @@ describe("xAI outbound compatibility headers", () => {
expect(lower(seen[0])).toEqual({
authorization: "Bearer xai-api-key",
"content-type": "application/json",
"user-agent": `opencodex-grok/${XAI_GROK_CLIENT_VERSION}`,
"user-agent": "opencodex-grok/1.0.25",
"x-grok-conv-id": deriveXaiConvId("codex-session-abc"),
"x-grok-req-id": expect.stringMatching(UUID_V4),
"x-grok-session-id": deriveXaiConvId("codex-session-abc"),
Expand Down
Loading