Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix: ensure Codex passthrough path sets instructions and store=false

AveryanAlex769be46bf9c7
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"];