From 4b161a61ac0c82655bc015bdd394e642c277b2c2 Mon Sep 17 00:00:00 2001 From: Noah Martino Date: Wed, 15 Jul 2026 10:44:00 -0400 Subject: [PATCH] feat: add Grok 4.5 and Composer 2.5 Fast models Expose the current SuperGrok OAuth chat model IDs in the default provider catalog and README so OpenCode can select them without a local config hack. Closes #3 --- README.md | 21 ++++++++++++++++----- src/constants.ts | 2 ++ test/plugin.test.ts | 5 ++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 78f87bd..29aa40a 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ C:\Users\ysnock\.config\opencode\opencode.json It now includes `provider.xai-oauth` with these model IDs: +- `grok-4.5` +- `grok-composer-2.5-fast` - `grok-4.3` - `grok-4.20-0309-reasoning` - `grok-4.20-0309-non-reasoning` @@ -89,6 +91,12 @@ Equivalent config block: "baseURL": "https://api.x.ai/v1" }, "models": { + "grok-4.5": { + "name": "Grok 4.5" + }, + "grok-composer-2.5-fast": { + "name": "Composer 2.5 Fast" + }, "grok-4.3": { "name": "Grok 4.3" }, @@ -140,7 +148,7 @@ xAI Grok OAuth 6. Select a model in OpenCode: ```text -xai-oauth/grok-4.3 +xai-oauth/grok-4.5 ``` ## Models @@ -149,13 +157,16 @@ xai-oauth/grok-4.3 | Model ID | Use | | ------------------------------ | ----------------------------------------- | -| `grok-4.3` | Default general-purpose Grok OAuth model. | +| `grok-4.5` | Default general-purpose Grok OAuth model. | +| `grok-composer-2.5-fast` | Composer 2.5 Fast coding model. | +| `grok-4.3` | Previous general-purpose Grok OAuth model.| | `grok-4.20-0309-reasoning` | Reasoning-heavy tasks. | | `grok-4.20-0309-non-reasoning` | Faster non-reasoning variant. | | `grok-4.20-multi-agent-0309` | Multi-agent oriented Grok variant. | -The fallback list mirrors the Hermes Agent xAI OAuth model list as of this -implementation. If xAI renames or retires models, update `src/constants.ts` and +The fallback list includes current SuperGrok OAuth chat models (`grok-4.5`, +`grok-composer-2.5-fast`) plus the earlier Hermes-compatible Grok IDs. If xAI +renames or retires models, update `src/constants.ts` and `~/.config/opencode/opencode.json`. ## Configuration @@ -232,7 +243,7 @@ C:\Users\ysnock\.config\opencode\opencode.json Then restart OpenCode and select: ```text -xai-oauth/grok-4.3 +xai-oauth/grok-4.5 ``` ### API Key Missing diff --git a/src/constants.ts b/src/constants.ts index 08b0f5b..edeab36 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -18,6 +18,8 @@ export const XAI_ACCESS_TOKEN_REFRESH_SKEW_MS = 120_000; export const OAUTH_CALLBACK_TIMEOUT_MS = 180_000; export const DEFAULT_XAI_MODELS = [ + "grok-4.5", + "grok-composer-2.5-fast", "grok-4.3", "grok-4.20-0309-reasoning", "grok-4.20-0309-non-reasoning", diff --git a/test/plugin.test.ts b/test/plugin.test.ts index f2766bb..46ef709 100644 --- a/test/plugin.test.ts +++ b/test/plugin.test.ts @@ -9,7 +9,10 @@ describe("plugin config", () => { const provider = (config.provider as Record)["xai-oauth"] as Record; expect(provider.npm).toBe("@ai-sdk/openai"); expect((provider.options as Record).baseURL).toBe("https://api.x.ai/v1"); - expect(Object.keys(provider.models as Record)).toContain("grok-4.3"); + const modelIds = Object.keys(provider.models as Record); + expect(modelIds).toContain("grok-4.5"); + expect(modelIds).toContain("grok-composer-2.5-fast"); + expect(modelIds).toContain("grok-4.3"); }); it("only treats api.x.ai as a safe API token destination", () => {