From 92b2067484db04bddf3527cccc7c4aafb1ee3f93 Mon Sep 17 00:00:00 2001 From: "@taltas" <6816042+taltas@users.noreply.github.com> Date: Fri, 14 Aug 2026 13:05:16 +0000 Subject: [PATCH 1/4] feat(opencode-go): add GLM-5.3 and Qwen3.8 Max --- packages/types/src/__tests__/lite-llm.test.ts | 3 +- .../types/src/__tests__/opencode-go.test.ts | 35 +++++++++++++++++++ .../src/__tests__/provider-settings.test.ts | 2 ++ packages/types/src/providers/lite-llm.ts | 2 ++ packages/types/src/providers/opencode-go.ts | 30 ++++++++++++++++ src/api/providers/opencode-go.ts | 6 ++-- 6 files changed, 74 insertions(+), 4 deletions(-) diff --git a/packages/types/src/__tests__/lite-llm.test.ts b/packages/types/src/__tests__/lite-llm.test.ts index 74436c1848..87fdfdd0ad 100644 --- a/packages/types/src/__tests__/lite-llm.test.ts +++ b/packages/types/src/__tests__/lite-llm.test.ts @@ -20,7 +20,8 @@ describe("LiteLLM preserveReasoning model detection", () => { it("matches case-insensitively", () => { expect(isLiteLLMPreserveReasoningModel("MiniMax-M2.7-Highspeed")).toBe(true) - expect(isLiteLLMPreserveReasoningModel("GLM-5.2")).toBe(true) + expect(isLiteLLMPreserveReasoningModel("GLM-5.3")).toBe(true) + expect(isLiteLLMPreserveReasoningModel("QWEN3.8-MAX")).toBe(true) }) it("does not match model ids that merely contain a known family as a substring", () => { diff --git a/packages/types/src/__tests__/opencode-go.test.ts b/packages/types/src/__tests__/opencode-go.test.ts index 8079fe1bcb..b52df8ae4d 100644 --- a/packages/types/src/__tests__/opencode-go.test.ts +++ b/packages/types/src/__tests__/opencode-go.test.ts @@ -10,6 +10,7 @@ import { describe("opencode-go registry", () => { const anthropicFormatModels = [ + "qwen3.8-max", "qwen3.7-max", "qwen3.7-plus", "qwen3.6-plus", @@ -21,6 +22,7 @@ describe("opencode-go registry", () => { "glm-5", "glm-5.1", "glm-5.2", + "glm-5.3", "kimi-k3", "kimi-k2.5", "kimi-k2.6", @@ -78,6 +80,39 @@ describe("opencode-go registry", () => { expect(info?.outputPrice).toBe(15.0) expect(info?.cacheReadsPrice).toBe(0.3) }) + + it("exposes current GLM-5.3 capabilities and Go pricing", () => { + const info = getOpencodeGoModelInfo("glm-5.3") + expect(info).toMatchObject({ + maxTokens: 131_072, + contextWindow: 1_000_000, + supportsImages: false, + supportsPromptCache: true, + supportsMaxTokens: true, + supportsReasoningEffort: ["low", "high", "max"], + reasoningEffort: "max", + preserveReasoning: true, + inputPrice: 1.4, + outputPrice: 4.4, + cacheReadsPrice: 0.26, + }) + }) + + it("exposes current Qwen3.8 Max capabilities and Go pricing", () => { + const info = getOpencodeGoModelInfo("qwen3.8-max") + expect(info).toMatchObject({ + maxTokens: 131_072, + contextWindow: 1_000_000, + supportsImages: true, + supportsPromptCache: true, + supportsMaxTokens: true, + preserveReasoning: true, + inputPrice: 2.0, + outputPrice: 6.0, + cacheReadsPrice: 0.25, + cacheWritesPrice: 2.5, + }) + }) }) describe("OPENCODE_GO_ANTHROPIC_FORMAT_MODELS", () => { diff --git a/packages/types/src/__tests__/provider-settings.test.ts b/packages/types/src/__tests__/provider-settings.test.ts index 33fa4e3aac..d73ae2af70 100644 --- a/packages/types/src/__tests__/provider-settings.test.ts +++ b/packages/types/src/__tests__/provider-settings.test.ts @@ -130,6 +130,7 @@ describe("getApiProtocol", () => { describe("Opencode Go provider", () => { it("should return 'anthropic' for opencode-go Anthropic-format models (Qwen/MiniMax)", () => { + expect(getApiProtocol(providerIdentifiers.opencodeGo, "qwen3.8-max")).toBe(ANTHROPIC_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "qwen3.7-max")).toBe(ANTHROPIC_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "qwen3.7-plus")).toBe(ANTHROPIC_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "qwen3.6-plus")).toBe(ANTHROPIC_API_PROTOCOL) @@ -139,6 +140,7 @@ describe("getApiProtocol", () => { }) it("should return 'openai' for opencode-go OpenAI-format models (GLM/DeepSeek/etc.)", () => { + expect(getApiProtocol(providerIdentifiers.opencodeGo, "glm-5.3")).toBe(OPENAI_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "glm-5.2")).toBe(OPENAI_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "deepseek-v4-pro")).toBe(OPENAI_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "kimi-k2.5")).toBe(OPENAI_API_PROTOCOL) diff --git a/packages/types/src/providers/lite-llm.ts b/packages/types/src/providers/lite-llm.ts index 2b72de9d51..00c30386b2 100644 --- a/packages/types/src/providers/lite-llm.ts +++ b/packages/types/src/providers/lite-llm.ts @@ -56,6 +56,7 @@ export const LITELLM_PRESERVE_REASONING_MODEL_IDS = [ "glm-5", "glm-5.1", "glm-5.2", + "glm-5.3", "glm-5-turbo", // bedrock.ts, minimax.ts, opencode-go.ts @@ -74,6 +75,7 @@ export const LITELLM_PRESERVE_REASONING_MODEL_IDS = [ "qwen3.6-plus", "qwen3.7-plus", "qwen3.7-max", + "qwen3.8-max", ] as const const LITELLM_PRESERVE_REASONING_MODEL_ID_SET = new Set(LITELLM_PRESERVE_REASONING_MODEL_IDS) diff --git a/packages/types/src/providers/opencode-go.ts b/packages/types/src/providers/opencode-go.ts index bd60c4d349..b878d458dc 100644 --- a/packages/types/src/providers/opencode-go.ts +++ b/packages/types/src/providers/opencode-go.ts @@ -102,6 +102,21 @@ export const opencodeGoModels: Record = { description: "GLM-5.2 is Zhipu's flagship model with a 1M context window, 128k max output, and dual thinking-effort modes (High/Max). It delivers top-tier long-context reasoning, coding, and agentic performance. Available via the Opencode Go plan.", }, + "glm-5.3": { + maxTokens: 131_072, + contextWindow: 1_000_000, + supportsImages: false, + supportsPromptCache: true, + supportsMaxTokens: true, + supportsReasoningEffort: ["low", "high", "max"], + reasoningEffort: "max", + preserveReasoning: true, + inputPrice: 1.4, + outputPrice: 4.4, + cacheReadsPrice: 0.26, + description: + "GLM-5.3 is Zhipu's flagship coding and agentic model with a 1M context window, 128k max output, and always-on reasoning with configurable effort (Low/High/Max). Available via the Opencode Go plan.", + }, // --- Moonshot Kimi --- "kimi-k3": { @@ -292,6 +307,20 @@ export const opencodeGoModels: Record = { description: "Qwen3.7 Max - Alibaba's flagship text-only reasoning agent model with a 1M context window, designed for long-horizon agent workflows. Available via the Opencode Go plan.", }, + "qwen3.8-max": { + maxTokens: 131_072, + contextWindow: 1_000_000, + supportsImages: true, + supportsPromptCache: true, + supportsMaxTokens: true, + preserveReasoning: true, + inputPrice: 2.0, + outputPrice: 6.0, + cacheReadsPrice: 0.25, + cacheWritesPrice: 2.5, + description: + "Qwen3.8 Max - Alibaba's flagship multimodal reasoning model with a 1M context window, 128k max output, and long-horizon coding and agentic capabilities. Available via the Opencode Go plan.", + }, // --- DeepSeek --- "deepseek-v4-pro": { @@ -349,6 +378,7 @@ export const opencodeGoModels: Record = { */ export const OPENCODE_GO_ANTHROPIC_FORMAT_MODELS = new Set([ // --- Alibaba Qwen --- + "qwen3.8-max", "qwen3.7-max", "qwen3.7-plus", "qwen3.6-plus", diff --git a/src/api/providers/opencode-go.ts b/src/api/providers/opencode-go.ts index be53dc1c02..6b3f633829 100644 --- a/src/api/providers/opencode-go.ts +++ b/src/api/providers/opencode-go.ts @@ -54,9 +54,9 @@ import { * * - OpenAI-compatible chat completions (`/v1/chat/completions`, "oa-compat") * — used by GLM, Kimi, DeepSeek, and MiMo models. - * - Anthropic Messages (`/v1/messages`) — used by Qwen (qwen3.7-max, - * qwen3.7-plus, qwen3.6-plus) and MiniMax (minimax-m3, minimax-m2.7, - * minimax-m2.5) models. + * - Anthropic Messages (`/v1/messages`) — used by Qwen (qwen3.8-max, + * qwen3.7-max, qwen3.7-plus, qwen3.6-plus) and MiniMax (minimax-m3, + * minimax-m2.7, minimax-m2.5) models. * * Sending an Anthropic-format model to the chat completions endpoint is * rejected with `401 Model is not supported for format oa-compat`, so this From 85af571dc7c27a9084bdaa726bf9f63846d2338d Mon Sep 17 00:00:00 2001 From: "@taltas" <6816042+taltas@users.noreply.github.com> Date: Fri, 14 Aug 2026 13:20:50 +0000 Subject: [PATCH 2/4] chore(opencode-go): narrow model update to Qwen --- packages/types/src/__tests__/lite-llm.test.ts | 2 +- .../types/src/__tests__/opencode-go.test.ts | 18 ------------------ .../src/__tests__/provider-settings.test.ts | 1 - packages/types/src/providers/lite-llm.ts | 1 - packages/types/src/providers/opencode-go.ts | 16 ---------------- 5 files changed, 1 insertion(+), 37 deletions(-) diff --git a/packages/types/src/__tests__/lite-llm.test.ts b/packages/types/src/__tests__/lite-llm.test.ts index 87fdfdd0ad..d9fd031c17 100644 --- a/packages/types/src/__tests__/lite-llm.test.ts +++ b/packages/types/src/__tests__/lite-llm.test.ts @@ -20,7 +20,7 @@ describe("LiteLLM preserveReasoning model detection", () => { it("matches case-insensitively", () => { expect(isLiteLLMPreserveReasoningModel("MiniMax-M2.7-Highspeed")).toBe(true) - expect(isLiteLLMPreserveReasoningModel("GLM-5.3")).toBe(true) + expect(isLiteLLMPreserveReasoningModel("GLM-5.2")).toBe(true) expect(isLiteLLMPreserveReasoningModel("QWEN3.8-MAX")).toBe(true) }) diff --git a/packages/types/src/__tests__/opencode-go.test.ts b/packages/types/src/__tests__/opencode-go.test.ts index b52df8ae4d..67a8299c1d 100644 --- a/packages/types/src/__tests__/opencode-go.test.ts +++ b/packages/types/src/__tests__/opencode-go.test.ts @@ -22,7 +22,6 @@ describe("opencode-go registry", () => { "glm-5", "glm-5.1", "glm-5.2", - "glm-5.3", "kimi-k3", "kimi-k2.5", "kimi-k2.6", @@ -81,23 +80,6 @@ describe("opencode-go registry", () => { expect(info?.cacheReadsPrice).toBe(0.3) }) - it("exposes current GLM-5.3 capabilities and Go pricing", () => { - const info = getOpencodeGoModelInfo("glm-5.3") - expect(info).toMatchObject({ - maxTokens: 131_072, - contextWindow: 1_000_000, - supportsImages: false, - supportsPromptCache: true, - supportsMaxTokens: true, - supportsReasoningEffort: ["low", "high", "max"], - reasoningEffort: "max", - preserveReasoning: true, - inputPrice: 1.4, - outputPrice: 4.4, - cacheReadsPrice: 0.26, - }) - }) - it("exposes current Qwen3.8 Max capabilities and Go pricing", () => { const info = getOpencodeGoModelInfo("qwen3.8-max") expect(info).toMatchObject({ diff --git a/packages/types/src/__tests__/provider-settings.test.ts b/packages/types/src/__tests__/provider-settings.test.ts index d73ae2af70..a43e2aa86c 100644 --- a/packages/types/src/__tests__/provider-settings.test.ts +++ b/packages/types/src/__tests__/provider-settings.test.ts @@ -140,7 +140,6 @@ describe("getApiProtocol", () => { }) it("should return 'openai' for opencode-go OpenAI-format models (GLM/DeepSeek/etc.)", () => { - expect(getApiProtocol(providerIdentifiers.opencodeGo, "glm-5.3")).toBe(OPENAI_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "glm-5.2")).toBe(OPENAI_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "deepseek-v4-pro")).toBe(OPENAI_API_PROTOCOL) expect(getApiProtocol(providerIdentifiers.opencodeGo, "kimi-k2.5")).toBe(OPENAI_API_PROTOCOL) diff --git a/packages/types/src/providers/lite-llm.ts b/packages/types/src/providers/lite-llm.ts index 00c30386b2..dc5ec6d86b 100644 --- a/packages/types/src/providers/lite-llm.ts +++ b/packages/types/src/providers/lite-llm.ts @@ -56,7 +56,6 @@ export const LITELLM_PRESERVE_REASONING_MODEL_IDS = [ "glm-5", "glm-5.1", "glm-5.2", - "glm-5.3", "glm-5-turbo", // bedrock.ts, minimax.ts, opencode-go.ts diff --git a/packages/types/src/providers/opencode-go.ts b/packages/types/src/providers/opencode-go.ts index b878d458dc..05b2db4a76 100644 --- a/packages/types/src/providers/opencode-go.ts +++ b/packages/types/src/providers/opencode-go.ts @@ -102,22 +102,6 @@ export const opencodeGoModels: Record = { description: "GLM-5.2 is Zhipu's flagship model with a 1M context window, 128k max output, and dual thinking-effort modes (High/Max). It delivers top-tier long-context reasoning, coding, and agentic performance. Available via the Opencode Go plan.", }, - "glm-5.3": { - maxTokens: 131_072, - contextWindow: 1_000_000, - supportsImages: false, - supportsPromptCache: true, - supportsMaxTokens: true, - supportsReasoningEffort: ["low", "high", "max"], - reasoningEffort: "max", - preserveReasoning: true, - inputPrice: 1.4, - outputPrice: 4.4, - cacheReadsPrice: 0.26, - description: - "GLM-5.3 is Zhipu's flagship coding and agentic model with a 1M context window, 128k max output, and always-on reasoning with configurable effort (Low/High/Max). Available via the Opencode Go plan.", - }, - // --- Moonshot Kimi --- "kimi-k3": { maxTokens: 131_072, // Default max_completion_tokens (configurable up to 1,048,576) From b826a87e5bb6da28870eed22212ba4901690deb2 Mon Sep 17 00:00:00 2001 From: "@taltas" <6816042+taltas@users.noreply.github.com> Date: Fri, 14 Aug 2026 15:30:39 +0000 Subject: [PATCH 3/4] fix(opencode-go): avoid unsupported reasoning preservation --- packages/types/src/__tests__/opencode-go.test.ts | 2 +- packages/types/src/providers/lite-llm.ts | 14 ++++++-------- packages/types/src/providers/opencode-go.ts | 1 - 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/types/src/__tests__/opencode-go.test.ts b/packages/types/src/__tests__/opencode-go.test.ts index 67a8299c1d..2189e182ad 100644 --- a/packages/types/src/__tests__/opencode-go.test.ts +++ b/packages/types/src/__tests__/opencode-go.test.ts @@ -88,12 +88,12 @@ describe("opencode-go registry", () => { supportsImages: true, supportsPromptCache: true, supportsMaxTokens: true, - preserveReasoning: true, inputPrice: 2.0, outputPrice: 6.0, cacheReadsPrice: 0.25, cacheWritesPrice: 2.5, }) + expect(info?.preserveReasoning).toBeUndefined() }) }) diff --git a/packages/types/src/providers/lite-llm.ts b/packages/types/src/providers/lite-llm.ts index dc5ec6d86b..31a2146dda 100644 --- a/packages/types/src/providers/lite-llm.ts +++ b/packages/types/src/providers/lite-llm.ts @@ -24,14 +24,12 @@ export const litellmDefaultModelInfo: ModelInfo = { * * Rather than matching model-family substrings with a regex (which can * over-match unrelated aliases, e.g. a family fragment appearing inside a - * longer unrelated model id), this is an explicit list of the exact model - * ids that set `preserveReasoning: true` in their native provider config - * (see deepseek.ts, mimo.ts, moonshot.ts, bedrock.ts, fireworks.ts, zai.ts, - * minimax.ts, opencode-go.ts). The same behavior is inferred for a - * LiteLLM-routed alias of the same underlying model. Keep this list in sync - * with those registries. This is still best-effort: unrecognized aliases or - * renamed deployments will not match, and callers should treat it as a - * heuristic, not a source of truth. + * longer unrelated model id), this is an explicit list of models whose + * OpenAI-compatible routes use interleaved `reasoning_content`. Native + * provider metadata informs this list where applicable, but gateway routes + * can have different preservation semantics. This is still best-effort: + * unrecognized aliases or renamed deployments will not match, and callers + * should treat it as a heuristic, not a source of truth. */ export const LITELLM_PRESERVE_REASONING_MODEL_IDS = [ // deepseek.ts diff --git a/packages/types/src/providers/opencode-go.ts b/packages/types/src/providers/opencode-go.ts index 05b2db4a76..760b5658b4 100644 --- a/packages/types/src/providers/opencode-go.ts +++ b/packages/types/src/providers/opencode-go.ts @@ -297,7 +297,6 @@ export const opencodeGoModels: Record = { supportsImages: true, supportsPromptCache: true, supportsMaxTokens: true, - preserveReasoning: true, inputPrice: 2.0, outputPrice: 6.0, cacheReadsPrice: 0.25, From 8b77b88025344676026d7f3a518b960cb2ba6d97 Mon Sep 17 00:00:00 2001 From: "@taltas" <6816042+taltas@users.noreply.github.com> Date: Fri, 14 Aug 2026 15:33:37 +0000 Subject: [PATCH 4/4] chore(opencode-go): keep provider sections separated --- packages/types/src/providers/opencode-go.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/types/src/providers/opencode-go.ts b/packages/types/src/providers/opencode-go.ts index 760b5658b4..ccbd55d5e5 100644 --- a/packages/types/src/providers/opencode-go.ts +++ b/packages/types/src/providers/opencode-go.ts @@ -102,6 +102,7 @@ export const opencodeGoModels: Record = { description: "GLM-5.2 is Zhipu's flagship model with a 1M context window, 128k max output, and dual thinking-effort modes (High/Max). It delivers top-tier long-context reasoning, coding, and agentic performance. Available via the Opencode Go plan.", }, + // --- Moonshot Kimi --- "kimi-k3": { maxTokens: 131_072, // Default max_completion_tokens (configurable up to 1,048,576)