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
8 changes: 5 additions & 3 deletions src/auth/xai/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 4 additions & 3 deletions src/config/xai-providers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions src/subagent/provider-family.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
Expand Down
Loading