diff --git a/src/auth/xai/constants.ts b/src/auth/xai/constants.ts index e8e13c0f7..38d07933a 100644 --- a/src/auth/xai/constants.ts +++ b/src/auth/xai/constants.ts @@ -19,11 +19,13 @@ export const XAI_SCOPES = ["openid", "profile", "email", "offline_access", "grok // API key). They authenticate against the CLI chat proxy, which exposes the // OpenAI-compatible /v1/chat/completions surface. export const XAI_BASE_URL = "https://cli-chat-proxy.grok.com/v1"; -// The grok CLI (which our OAuth scope mirrors) exposes only two models: Grok 4.5 -// (Grok Build's default coding model) and Composer 2.5 Fast. Mirror `grok models` -// exactly — other model ids are rejected for grok-cli OAuth credentials. +// Grok-cli OAuth credentials only accept model ids the CLI chat proxy serves. +// Keep the catalog aligned with Grok Build / xAI listings; default stays the +// last CLI-advertised coding model until the proxy is confirmed to accept a +// newer flagship as the session default. export const XAI_DEFAULT_MODELS = [ "grok-4.5", + "grok-4.6", "grok-composer-2.5-fast", ] as const; diff --git a/src/config/xai-providers.test.ts b/src/config/xai-providers.test.ts index f20c18aca..6fc1b782a 100644 --- a/src/config/xai-providers.test.ts +++ b/src/config/xai-providers.test.ts @@ -12,9 +12,10 @@ import { } from "./xai-providers.js"; describe("xAI OAuth provider projection", () => { - test("default models mirror grok CLI catalog", () => { - expect([...XAI_DEFAULT_MODELS]).toEqual(["grok-4.5", "grok-composer-2.5-fast"]); - expect(XAI_DEFAULT_MODELS[0]).toBe("grok-4.5"); + test("default models include Grok 4.6 while defaulting to the CLI coding model", () => { + const models: string[] = [...XAI_DEFAULT_MODELS]; + expect(models).toEqual(["grok-4.5", "grok-4.6", "grok-composer-2.5-fast"]); + expect(models[0]).toBe("grok-4.5"); }); const profile: XaiProfile = { diff --git a/src/subagent/provider-family.test.ts b/src/subagent/provider-family.test.ts index ef65d359f..bcdba7513 100644 --- a/src/subagent/provider-family.test.ts +++ b/src/subagent/provider-family.test.ts @@ -85,6 +85,7 @@ describe("isKimiLeafProvider", () => { describe("detectModelFamily", () => { test("detects grok, kimi, and default", () => { expect(detectModelFamily({ providerName: "xai/default", model: "grok-4.5" })).toBe("grok"); + expect(detectModelFamily({ providerName: "xai/default", model: "grok-4.6" })).toBe("grok"); expect(detectModelFamily({ providerName: "moonshot", model: "kimi-k2" })).toBe("kimi"); expect(detectModelFamily({ providerName: "anthropic", model: "claude-sonnet-4" })).toBe("default"); });