From 45565a883fa4fc26b5dec85f555e62aca635f10d Mon Sep 17 00:00:00 2001 From: Thomas Byr Date: Sat, 22 Aug 2026 23:24:49 +0200 Subject: [PATCH] feat(models): add GLM-5.3 pricing and reasoning levels --- CHANGELOG.md | 1 + src/core.ts | 2 +- src/models.ts | 5 +++-- src/pricing.ts | 3 ++- tests/fixtures/commandcode-model-ids.json | 3 ++- tests/fixtures/commandcode-pricing.json | 3 ++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee3cd9b..c6d7f95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Add `zai-org/GLM-5.3` with its verified reasoning efforts and display pricing. - Prefer Command Code's Provider API (`/provider/v1/chat/completions` and `/provider/v1/messages`) and automatically fall back to the existing `/alpha/generate` transport only when the Provider API returns `403 upgrade_required` for a Go-plan account. - Remember the detected transport for the running process, re-detect it when credentials change, prevent stale in-flight requests from overwriting the new credential's transport, and never fall back for unrelated authentication, permission, rate-limit, network, or server failures. - Use Pi's native OpenAI- and Anthropic-compatible providers for Provider API streaming, including adaptive thinking for current reasoning-capable Claude models, while preserving the existing hardened generate transport, dynamic model discovery, offline cache, refresh/status commands, pricing, and OAuth credentials. diff --git a/src/core.ts b/src/core.ts index f1898dd..2eb92f8 100644 --- a/src/core.ts +++ b/src/core.ts @@ -43,7 +43,7 @@ export * from "./overflow.ts" export * from "./types.ts" export const DEFAULT_API_BASE = "https://api.commandcode.ai" -export const COMMAND_CODE_CLI_VERSION = "1.15.1" +export const COMMAND_CODE_CLI_VERSION = "1.32.1" const DEFAULT_GENERATE_MAX_TOKENS = 64_000 const DEFAULT_MAX_RETRIES = 0 diff --git a/src/models.ts b/src/models.ts index 3f8c7e9..e102c00 100644 --- a/src/models.ts +++ b/src/models.ts @@ -12,7 +12,7 @@ export type CommandCodeApi = "openai-completions" | "anthropic-messages" export type CommandCodeInputType = "text" | "image" /** - * Model input modalities from the command-code@1.15.1 bundled catalog. + * Model input modalities from the command-code@1.32.1 bundled catalog. * Models omitted here remain text-only so newly discovered IDs never claim * image support without upstream evidence. */ @@ -74,7 +74,7 @@ type CommandCodeReasoningEffort = Exclude * Per-model reasoning efforts supported by Command Code's generate endpoint. * * The Provider API does not expose reasoning metadata. This is an exact - * snapshot of `reasoningEfforts` from the command-code@1.15.1 model catalog + * snapshot of `reasoningEfforts` from the command-code@1.32.1 model catalog * (`packages/shared/src/model-catalog.ts`, also published in the generated * `dist/bundled/command-code-knowledge/reference/models.md`). Models omitted * here let Command Code choose their reasoning depth, matching the CLI. @@ -103,6 +103,7 @@ export const MODEL_EFFORTS: Readonly> = { }, "moonshotai/Kimi-K2.6": { input: 0.95, output: 4, cacheRead: 0.16, cacheWrite: 0 }, "moonshotai/Kimi-K2.5": { input: 0.6, output: 3, cacheRead: 0.1, cacheWrite: 0 }, + "zai-org/GLM-5.3": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 }, "zai-org/GLM-5.2": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 }, "zai-org/GLM-5.2-Fast": { input: 3, output: 10.25, cacheRead: 0.5, cacheWrite: 0 }, "zai-org/GLM-5.1": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 }, diff --git a/tests/fixtures/commandcode-model-ids.json b/tests/fixtures/commandcode-model-ids.json index f0974cd..1b9898a 100644 --- a/tests/fixtures/commandcode-model-ids.json +++ b/tests/fixtures/commandcode-model-ids.json @@ -1,5 +1,5 @@ { - "fetchedAt": "2026-08-04T10:12:57.953Z", + "fetchedAt": "2026-08-22T21:19:37.782Z", "source": "https://api.commandcode.ai/provider/v1/models", "modelIds": [ "claude-sonnet-5", @@ -23,6 +23,7 @@ "moonshotai/Kimi-K2.7-Code-Highspeed", "moonshotai/Kimi-K2.6", "moonshotai/Kimi-K2.5", + "zai-org/GLM-5.3", "zai-org/GLM-5.2", "zai-org/GLM-5.2-Fast", "zai-org/GLM-5.1", diff --git a/tests/fixtures/commandcode-pricing.json b/tests/fixtures/commandcode-pricing.json index 6a508fd..5b2070c 100644 --- a/tests/fixtures/commandcode-pricing.json +++ b/tests/fixtures/commandcode-pricing.json @@ -1,5 +1,5 @@ { - "verifiedAt": "2026-08-20", + "verifiedAt": "2026-08-22", "source": "https://commandcode.ai/docs/resources/pricing-limits", "tierPolicy": "Use request-wide input tiers; the highest threshold exceeded by input plus cache tokens applies to the full request.", "tiers": { @@ -18,6 +18,7 @@ "moonshotai/Kimi-K2.7-Code-Highspeed": [1.9, 8, 0.38, 0], "moonshotai/Kimi-K2.6": [0.95, 4, 0.16, 0], "moonshotai/Kimi-K2.5": [0.6, 3, 0.1, 0], + "zai-org/GLM-5.3": [1.4, 4.4, 0.26, 0], "zai-org/GLM-5.2": [1.4, 4.4, 0.26, 0], "zai-org/GLM-5.2-Fast": [3, 10.25, 0.5, 0], "zai-org/GLM-5.1": [1.4, 4.4, 0.26, 0],