Files
openclaw/extensions/xai/model-id.ts
EricKwan e00ef16ee7 fix(xai): follow OAuth default model automatically (#115617)
* fix(xai): default OAuth login to Grok 4.5

* fix(xai): follow OAuth default model automatically

* fix(xai): send OAuth proxy request headers

* fix(xai): avoid provider API shadowing

* fix(qa): restore current main validation gates

---------

Co-authored-by: echeung <echeung@agentsonly.com>
Co-authored-by: fuller-stack-dev <263060202+fuller-stack-dev@users.noreply.github.com>
2026-07-29 23:05:29 +00:00

25 lines
630 B
TypeScript

// Xai plugin module implements model id behavior.
export const XAI_OAUTH_AUTO_MODEL_ID = "auto";
export function normalizeXaiModelId(id: string): string {
if (id === "grok-4.3-latest") {
return "grok-4.3";
}
if (id === "grok-4.5-latest") {
return "grok-4.5";
}
if (id === "grok-build-latest") {
return "grok-4.5";
}
if (id === "grok-code-fast-1" || id === "grok-code-fast" || id === "grok-code-fast-1-0825") {
return "grok-build-0.1";
}
if (id === "grok-4-fast-reasoning") {
return "grok-4-fast";
}
if (id === "grok-4-1-fast-reasoning") {
return "grok-4-1-fast";
}
return id;
}