Files
OmniRoute/tests/unit/executor-codex-gpt56-lite-ultra.test.ts
Bob.Hou d92bc8ef7a feat(sse): restore GPT-6 Astra effort aliases and Codex 0.153.4 pin (#13026)
Three related things that genuinely belong together: the registry and suffix splitter not knowing Astra while the live catalog serves it, the Codex client pin Astra requires, and dropping `next/font/google` so a production image build does not reach fonts.googleapis.com.

---

Validated in one consolidated worktree cut from `release/v3.8.51`, boarded with the other 19 PRs of this batch. Two in-batch conflicts, both additive and resolved by keeping each side: the `ENVIRONMENT.md` table (#13035 + #13011) and the `chatHelpers.ts` import block (#12975 on the tip + #13017).

- `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK; `check:docs-counts` migrations ✓
- complexity 2816 / baseline 3218 and cognitive-complexity 1271 / baseline 1437 — both under baseline
- 531 of 532 focused assertions green across the batch's 46 test files
- `check-file-size` rebaselined for the batch's real growth (annotation `_rebaseline_2026_09_11_mergebatch_v3851_houminxi`, landed on #13038), attributed per PR

The single red is **not this batch**: `tests/unit/combo/quota-weighted-strategy.test.ts` → "A/B isolation: 7 hard-empty + 2 at 0.5% + 1 at 40%, floor=1" asserts an order between two connections of identical weight and flakes on the pure tip too — 2 failures in 4 runs at `origin/release/v3.8.51` with nothing from this batch applied.

⚠️ base-red inherited: #12732 — `Docs Gates`, `Merge integrity`, `No new ESLint warnings`, `Unit Tests fast-path` and `Fast Quality Gates` reproduce on the pure tip (provider count 356 vs the 358 the modules define, SKILL.md drift, and `open-sse/utils/stream.ts` at 3115 > frozen 3098, untouched here).

Thanks @HouMinXi — the live evidence on these (X500 logs, `storage.sqlite` state, real `/v1/models` probes, the 36-minute outage write-up) is what let a 20-PR batch be reviewed as a unit.
2026-09-11 19:28:25 -03:00

96 lines
3.7 KiB
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import { CodexExecutor } from "../../open-sse/executors/codex.ts";
// Issue #7821: enforceCodexResponsesLiteParallelToolCalls() used to have zero model
// awareness — it force-set parallel_tool_calls:false for EVERY model when Responses
// Lite was detected, including gpt-5.6-sol/-terra at "ultra" effort (and gpt-5.6-luna
// at "max"), whose delegation-to-sub-agents capability depends on parallel_tool_calls
// staying enabled. This collided with the effort-clamp comment near clampEffort()
// ("Ultra coordinates delegation in Codex clients") and is why GPT-5.6 was reported
// unusable through the stock Codex CLI/App (which enables Responses Lite by default)
// while GPT-5.5 (no delegation tier) was unaffected.
//
// Covers the interaction (lite marker + delegation-dependent model/effort together),
// not just each behavior in isolation — that interaction was the actual blind spot.
async function runLiteRequest(model: string): Promise<Record<string, unknown>[]> {
const executor = new CodexExecutor();
const originalFetch = globalThis.fetch;
const capturedBodies: Record<string, unknown>[] = [];
globalThis.fetch = async (_url, init) => {
capturedBodies.push(JSON.parse(String(init?.body || "{}")));
return new Response(JSON.stringify({ id: "resp_lite", object: "response" }), {
status: 200,
headers: { "Content-Type": "application/json" },
});
};
const body = {
_nativeCodexPassthrough: true,
model,
input: [],
parallel_tool_calls: true,
};
try {
await executor.execute({
model,
body,
stream: true,
credentials: { accessToken: "codex-token" },
clientHeaders: { "X-OpenAI-Internal-Codex-Responses-Lite": "true" },
});
} finally {
globalThis.fetch = originalFetch;
}
return capturedBodies;
}
test("Responses Lite must not strip parallel_tool_calls for GPT-5.6 sol ultra-tier delegation", async () => {
const capturedBodies = await runLiteRequest("gpt-5.6-sol-ultra");
assert.equal(
capturedBodies[0].parallel_tool_calls,
true,
"Responses Lite stripped parallel_tool_calls for an ultra-tier GPT-5.6 delegation " +
"request — this breaks sub-agent delegation and is the root cause of #7821"
);
});
test("Responses Lite must not strip parallel_tool_calls for GPT-5.6 terra ultra-tier delegation", async () => {
const capturedBodies = await runLiteRequest("gpt-5.6-terra-ultra");
assert.equal(capturedBodies[0].parallel_tool_calls, true);
});
test("Responses Lite must not strip parallel_tool_calls for GPT-5.6 luna max-tier delegation", async () => {
const capturedBodies = await runLiteRequest("gpt-5.6-luna-max");
assert.equal(capturedBodies[0].parallel_tool_calls, true);
});
test("Responses Lite preserves parallel tool calls for Astra ultra delegation", async () => {
const capturedBodies = await runLiteRequest("gpt-6-astra-ultra");
assert.equal(capturedBodies.length, 1);
assert.equal(capturedBodies[0].parallel_tool_calls, true);
});
test("Responses Lite still forces parallel_tool_calls:false for non-delegation GPT-5.5", async () => {
const capturedBodies = await runLiteRequest("gpt-5.5");
assert.equal(
capturedBodies[0].parallel_tool_calls,
false,
"GPT-5.5 has no delegation tier — Responses Lite behavior for it must be unchanged"
);
});
test("Responses Lite still forces parallel_tool_calls:false for GPT-5.6 sol at non-ultra effort", async () => {
const capturedBodies = await runLiteRequest("gpt-5.6-sol-high");
assert.equal(
capturedBodies[0].parallel_tool_calls,
false,
"Non-ultra GPT-5.6 effort tiers have no delegation dependency — must stay forced off"
);
});