Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 24 additions & 0 deletions src/providers/command-code-efforts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions tests/command-code-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
28 changes: 28 additions & 0 deletions tests/provider-registry-parity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading