Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion packages/types/src/__tests__/lite-llm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.2")).toBe(true)
expect(isLiteLLMPreserveReasoningModel("GLM-5.3")).toBe(true)
})

it("does not match model ids that merely contain a known family as a substring", () => {
Expand Down
17 changes: 17 additions & 0 deletions packages/types/src/__tests__/opencode-go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe("opencode-go registry", () => {
"glm-5",
"glm-5.1",
"glm-5.2",
"glm-5.3",
"kimi-k3",
"kimi-k2.5",
"kimi-k2.6",
Expand Down Expand Up @@ -78,6 +79,22 @@ describe("opencode-go registry", () => {
expect(info?.outputPrice).toBe(15.0)
expect(info?.cacheReadsPrice).toBe(0.3)
})

it("glm-5.3 exposes its native context, pricing, and always-on reasoning levels", () => {
const info = getOpencodeGoModelInfo("glm-5.3")
expect(info).toBeDefined()
expect(info?.maxTokens).toBe(131_072)
expect(info?.contextWindow).toBe(1_000_000)
expect(info?.supportsImages).toBe(false)
expect(info?.supportsPromptCache).toBe(true)
expect(info?.supportsMaxTokens).toBe(true)
expect(info?.supportsReasoningEffort).toEqual(["low", "high", "max"])
expect(info?.reasoningEffort).toBe("max")
expect(info?.preserveReasoning).toBe(true)
expect(info?.inputPrice).toBe(1.4)
expect(info?.outputPrice).toBe(4.4)
expect(info?.cacheReadsPrice).toBe(0.26)
})
})

describe("OPENCODE_GO_ANTHROPIC_FORMAT_MODELS", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/__tests__/provider-settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe("getApiProtocol", () => {
})

it("should return 'openai' for opencode-go OpenAI-format models (GLM/DeepSeek/etc.)", () => {
expect(getApiProtocol(providerIdentifiers.opencodeGo, "glm-5.2")).toBe(OPENAI_API_PROTOCOL)
expect(getApiProtocol(providerIdentifiers.opencodeGo, "glm-5.3")).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)
expect(getApiProtocol(providerIdentifiers.opencodeGo, "mimo-v2.5")).toBe(OPENAI_API_PROTOCOL)
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/providers/lite-llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions packages/types/src/providers/opencode-go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,21 @@ export const opencodeGoModels: Record<string, ModelInfo> = {
description:
"GLM-5.1 is Zhipu's most capable model with a 200k context window, 128k max output, and built-in thinking capabilities. 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 agent 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.",
},
"glm-5.2": {
maxTokens: 131_072,
contextWindow: 1_000_000,
Expand Down
2 changes: 1 addition & 1 deletion src/api/providers/__tests__/opencode-go.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ describe("OpencodeGoHandler", () => {
})

it("classifies OpenAI-compatible Go models as non-Anthropic-format", () => {
expect(isOpencodeGoAnthropicFormatModel("glm-5.2")).toBe(false)
expect(isOpencodeGoAnthropicFormatModel("glm-5.3")).toBe(false)
expect(isOpencodeGoAnthropicFormatModel("kimi-k2.6")).toBe(false)
expect(isOpencodeGoAnthropicFormatModel("deepseek-v4-pro")).toBe(false)
expect(isOpencodeGoAnthropicFormatModel("mimo-v2.5")).toBe(false)
Expand Down
4 changes: 2 additions & 2 deletions src/api/providers/fetchers/__tests__/litellm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ describe("getLiteLLMModels", () => {
data: {
data: [
{
model_name: "glm-5.2",
model_name: "glm-5.3",
model_info: {
max_tokens: 8192,
max_input_tokens: 128000,
Expand All @@ -782,7 +782,7 @@ describe("getLiteLLMModels", () => {

const result = await getLiteLLMModels("test-api-key", "http://localhost:4000")

expect(result["glm-5.2"]).toMatchObject({ preserveReasoning: true })
expect(result["glm-5.3"]).toMatchObject({ preserveReasoning: true })
})

it("does not match a model id that merely contains a known family as a substring", async () => {
Expand Down
14 changes: 14 additions & 0 deletions src/api/providers/fetchers/__tests__/opencode-go.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ describe("Opencode Go Fetchers", () => {
expect(info.outputPrice).toBe(4.4)
})

it("resolves GLM-5.3 with always-on Low/High/Max reasoning effort", () => {
const info = parseOpencodeGoModel({ id: "glm-5.3" })
expect(info.contextWindow).toBe(1_000_000)
expect(info.maxTokens).toBe(131_072)
expect(info.supportsPromptCache).toBe(true)
expect(info.supportsMaxTokens).toBe(true)
expect(info.supportsReasoningEffort).toEqual(["low", "high", "max"])
expect(info.reasoningEffort).toBe("max")
expect(info.preserveReasoning).toBe(true)
expect(info.inputPrice).toBe(1.4)
expect(info.outputPrice).toBe(4.4)
expect(info.cacheReadsPrice).toBe(0.26)
})

it("falls back to defaults for an unknown model with no cache pricing", () => {
const info = parseOpencodeGoModel({ id: "x", context_window: 100000, max_tokens: 8000 })
expect(info.supportsPromptCache).toBe(false)
Expand Down
Loading