From f6e5e5d9af886258dd95eb63f404c97d8e590187 Mon Sep 17 00:00:00 2001 From: bitkyc08-arch Date: Sat, 29 Aug 2026 23:42:43 +0900 Subject: [PATCH] fix(providers): give the live GLM-5.3-Flash route its own effort ladder z-ai/glm-5.3-flash reached the catalog with supported_reasoning_levels=[], so the Codex App effort picker rendered empty and requests carried requestedEffort: none. The id shares neither vendor prefix nor model with the table's zai-org/GLM-5.3, so modelRecordValue (exact / colon-family / case-folded) cannot bridge them and configuredReasoningEfforts falls through to the provider-level empty ladder. The ladder is measured, not assumed: the profile page ships a serialized React payload whose string table decodes 224=low 225=medium 226=high 227=xhigh 569=max, this model's array is [224,226,569], and the index map reproduces all six already-committed rows the same page carries. Closes #2883 --- src/providers/command-code-efforts.ts | 24 ++++++++++++++++++++++ tests/command-code-provider.test.ts | 25 +++++++++++++++++++++++ tests/provider-registry-parity.test.ts | 28 ++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/src/providers/command-code-efforts.ts b/src/providers/command-code-efforts.ts index 1cd4831662..b5bfa93b37 100644 --- a/src/providers/command-code-efforts.ts +++ b/src/providers/command-code-efforts.ts @@ -73,6 +73,30 @@ const COMMAND_CODE_MODEL_EFFORTS = { efforts: ["low", "high", "max"], profileUrl: "https://commandcode.ai/models/glm-5-3", }, + /* + * GLM-5.3-Flash (#2883). Reported as advertising NO efforts at all: the live + * route is `z-ai/glm-5.3-flash`, which shares neither vendor prefix nor model + * id with `zai-org/GLM-5.3` above, so `modelRecordValue` cannot bridge them + * (exact / colon-family / case-folded only — by design; a substring match here + * would merge two genuinely different models across two vendor namespaces). + * + * PROVENANCE: unlike the #2647 rows above, this ladder is MEASURED, not + * reported. commandcode.ai renders the profile client-side, but the delivered + * HTML ships a serialized React payload whose string table can be read + * directly: in the 2026-08-29 fetch of /models/glm-5-3-flash (HTTP 200, + * 228749 bytes) the indices resolve as 224=low, 225=medium, 226=high, + * 227=xhigh, 569=max, and this model's array is [224,226,569]. + * + * The index map was cross-validated against every row in this table that the + * same page carries: deepseek-v4-pro and -flash [226,569], gpt-5.6-luna + * [224,225,226,227,569], gemini-3.7-flash [224,225,226], GLM-5.2 [226,569], + * GLM-5.3 [224,226,569] — six for six against the values already committed + * here. No authenticated upstream generate probe was performed. + */ + "z-ai/glm-5.3-flash": { + efforts: ["low", "high", "max"], + profileUrl: "https://commandcode.ai/models/glm-5-3-flash", + }, // Muse Spark: CLI currently prints "has no adjustable reasoning effort" and // blocks --effort locally, but the upstream /alpha/generate endpoint accepts // reasoning_effort low..max for meta/muse-spark-1.2-contributor (verified diff --git a/tests/command-code-provider.test.ts b/tests/command-code-provider.test.ts index 730d01638c..f434687a1c 100644 --- a/tests/command-code-provider.test.ts +++ b/tests/command-code-provider.test.ts @@ -87,6 +87,31 @@ describe("Command Code provider", () => { }); }); + /* + * #2883. `z-ai/glm-5.3-flash` is a live-discovered route whose id shares + * neither the vendor prefix nor the model of `zai-org/GLM-5.3`, so no + * `modelRecordValue` relaxation reaches it — only an explicit row does. Both + * presets must carry it, because the picker is empty on whichever one the + * user configured, and the two entries are separately constructed. + */ + test("the live GLM-5.3-Flash route carries its own effort ladder on both presets", () => { + const oauth = PROVIDER_REGISTRY.find(row => row.id === "command-code"); + const apiKey = PROVIDER_REGISTRY.find(row => row.id === "commandcode"); + for (const [label, entry] of [["oauth", oauth], ["api-key", apiKey]] as const) { + expect(entry?.modelReasoningEfforts?.["z-ai/glm-5.3-flash"], `${label} preset ladder`) + .toEqual(["low", "high", "max"]); + } + // Distinct rows for distinct upstream models: GLM-5.3 and GLM-5.3-Flash happen to + // share a ladder today, but neither may be derived from the other. + expect(commandCodeReasoningEfforts("z-ai/glm-5.3-flash")).toEqual(["low", "high", "max"]); + expect(commandCodeReasoningEfforts("zai-org/GLM-5.3")).toEqual(["low", "high", "max"]); + // The reported id arrives lowercase from live discovery; a caller may still fold case. + expect(commandCodeReasoningEfforts("Z-AI/GLM-5.3-Flash")).toEqual(["low", "high", "max"]); + // Nothing widened into a substring match: a sibling that upstream does not list + // must stay unknown rather than inheriting the Flash ladder. + expect(commandCodeReasoningEfforts("z-ai/glm-5.3-flash-vision")).toBeUndefined(); + }); + test("OAuth and API-key presets share only verified image capabilities", () => { const oauth = PROVIDER_REGISTRY.find(row => row.id === "command-code"); const apiKey = PROVIDER_REGISTRY.find(row => row.id === "commandcode"); diff --git a/tests/provider-registry-parity.test.ts b/tests/provider-registry-parity.test.ts index 53c7fc2076..f9c3c51e1b 100644 --- a/tests/provider-registry-parity.test.ts +++ b/tests/provider-registry-parity.test.ts @@ -1003,6 +1003,34 @@ describe("provider registry parity", () => { // so the request still reaches Command Code as `deepseek/deepseek-v4-flash`. expect(entries.find(e => e.slug === "commandcode/deepseek-deepseek-v4-flash")).toBeTruthy(); }); + + /* + * #2883, at the surface the reporter actually saw. A live-discovered model with no + * row in the effort table falls through `configuredReasoningEfforts` to the + * provider-level `reasoningEfforts: []`, which `applyProviderConfigHints` then + * writes onto the model — so the Codex App picker renders empty and the request + * carries `requestedEffort: "none"`. Asserting the catalog entry rather than just + * the table is what makes this a regression test for the symptom. + */ + test("the Command Code GLM-5.3-Flash route reaches the catalog with a selectable ladder", () => { + const commandcode = PROVIDER_REGISTRY.find(entry => entry.id === "commandcode"); + const seed = providerConfigSeed(commandcode!); + const model = applyProviderConfigHints("commandcode", seed, { + id: "z-ai/glm-5.3-flash", + provider: "commandcode", + }); + expect(model.id).toBe("z-ai/glm-5.3-flash"); + expect(model.reasoningEfforts).toEqual(["low", "high", "max"]); + + const entries = buildCatalogEntries(nativeTemplate() as never, [], [model]); + const entry = entries.find(e => e.slug === "commandcode/z-ai-glm-5.3-flash"); + expect(entry).toBeTruthy(); + // The empty ladder is exactly the reported symptom: an empty picker in the app. + expect(entry?.supported_reasoning_levels).not.toEqual([]); + // Routed catalogs append the synthetic top rung, as every other routed row above does. + expect((entry?.supported_reasoning_levels as { effort: string }[]).map(l => l.effort)) + .toEqual(["low", "high", "max", "ultra"]); + }); /* * #1043. Zen publishes no modality metadata, so the classification below is an * empirical list measured against the live endpoint on 2026-08-05, not something