diff --git a/open-sse/executors/codex.ts b/open-sse/executors/codex.ts index 4826278ce3..7bf1ef6228 100644 --- a/open-sse/executors/codex.ts +++ b/open-sse/executors/codex.ts @@ -260,11 +260,9 @@ export class CodexExecutor extends BaseExecutor { body.service_tier = CODEX_FAST_WIRE_VALUE; } - if (nativeCodexPassthrough) { - return body; - } - // If no instructions provided, inject default Codex instructions + // NOTE: must run before the passthrough return — Codex upstream rejects + // requests without instructions even when the body is forwarded as-is. if (!body.instructions || body.instructions.trim() === "") { body.instructions = CODEX_DEFAULT_INSTRUCTIONS; } @@ -272,6 +270,10 @@ export class CodexExecutor extends BaseExecutor { // Ensure store is false (Codex requirement) body.store = false; + if (nativeCodexPassthrough) { + return body; + } + // Extract thinking level from model name suffix // e.g., gpt-5.3-codex-high → high, gpt-5.3-codex → medium (default) const effortLevels = ["none", "low", "medium", "high", "xhigh"];