test(release): honor Codex ultra request mapping (#127058)

This commit is contained in:
Dallin Romney
2026-08-21 09:27:28 -07:00
committed by GitHub
parent d993742d2c
commit 7600b2a36a
@@ -276,11 +276,11 @@ function resolveCodexHarnessThinkingLevel(raw: string | undefined): CodexHarness
return normalized as CodexHarnessThinkingLevel;
}
function resolveCodexHarnessExpectedEffort(modelId: string): string | null {
function resolveCodexHarnessExpectedRequestEffort(modelId: string): string | null {
const configured = process.env.OPENCLAW_LIVE_CODEX_HARNESS_EXPECTED_EFFORT;
if (configured?.trim()) {
const expected = resolveCodexHarnessThinkingLevel(configured);
return expected === "off" ? null : expected;
return expected === "off" ? null : expected === "ultra" ? "max" : expected;
}
const supported = CODEX_HARNESS_SUPPORTED_EFFORTS.get(modelId);
if (!supported) {
@@ -289,14 +289,14 @@ function resolveCodexHarnessExpectedEffort(modelId: string): string | null {
if (CODEX_HARNESS_THINKING === "off") {
return null;
}
// Independent oracle for the pinned Codex model catalog. Lower requested
// levels choose the nearest advertised effort; Ultra remains explicit.
// Codex preserves Ultra in config but intentionally sends Max to the model.
// Compare the request-facing lifecycle event to that wire contract.
const candidates =
CODEX_HARNESS_THINKING === "ultra"
? supported
: supported.filter((effort) => effort !== "ultra");
const requestedRank = CODEX_HARNESS_REASONING_EFFORTS.indexOf(CODEX_HARNESS_THINKING);
return (
const configuredEffort =
candidates.find(
(effort) =>
CODEX_HARNESS_REASONING_EFFORTS.indexOf(
@@ -304,8 +304,8 @@ function resolveCodexHarnessExpectedEffort(modelId: string): string | null {
) >= requestedRank,
) ??
candidates.at(-1) ??
null
);
null;
return configuredEffort === "ultra" ? "max" : configuredEffort;
}
function logCodexLiveStep(step: string, details?: Record<string, unknown>): void {
@@ -846,7 +846,7 @@ function recordCodexAttemptIdentity(params: {
expect(turnStarting?.data).toMatchObject({ model: expectedModel });
const actualEffort = turnStarting?.data?.effort;
const actualCollaborationEffort = turnStarting?.data?.collaborationEffort;
const expectedEffort = resolveCodexHarnessExpectedEffort(expectedModel);
const expectedEffort = resolveCodexHarnessExpectedRequestEffort(expectedModel);
expect(actualEffort ?? null).toBe(expectedEffort);
expect(actualCollaborationEffort ?? null).toBe(actualEffort ?? null);
if (CODEX_HARNESS_FULL_CONTEXT) {