test(cli): make codex model assertions resilient to catalog changes

The 15-provider test hard-coded exact model IDs (gpt-5.3-codex-spark,
etc.) which depend on the external codex CLI's model/list endpoint.
Replace with structural checks: all IDs in gpt- family, at least one
codex-optimized model, and all models have required fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2026-04-11 02:04:53 +00:00
parent 93d077e53e
commit b315f5914a

View File

@@ -194,10 +194,18 @@ try {
assert(data.length >= 5, "codex model list should include current codex lineup");
const ids = data.map((m) => m.id);
assert.strictEqual(new Set(ids).size, ids.length, "codex model IDs should be unique");
assert(ids.includes("gpt-5.3-codex"), "codex output should include gpt-5.3-codex");
assert(ids.includes("gpt-5.3-codex-spark"), "codex output should include gpt-5.3-codex-spark");
assert(ids.includes("gpt-5.4"), "codex output should include gpt-5.4");
assert(ids.includes("gpt-5.4-mini"), "codex output should include gpt-5.4-mini");
assert(
ids.every((id) => id.startsWith("gpt-")),
"all codex model IDs should be from the gpt family",
);
assert(
ids.some((id) => id.includes("codex")),
"codex model list should include at least one codex-optimized model",
);
assert(
data.every((m) => m.model && m.id && m.description),
"every codex model should have model, id, and description fields",
);
console.log("✓ provider models codex includes concrete codex model IDs\n");
}