diff --git a/CHANGELOG.md b/CHANGELOG.md index d5b422fc05..4707bf82ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ ### 🐛 Bug Fixes - **fix(gemini-cli):** separate Cloud Code transport from Antigravity (#1869 — thanks @dhaern) +- **fix(codex):** map prompt field to input array for Cursor compatibility (fixes #1872) +- **fix(core):** align stream parameter default to false per strict OpenAI spec (fixes #1873) ### 🏆 Release Attribution & Retroactive Credits diff --git a/open-sse/executors/codex.ts b/open-sse/executors/codex.ts index e84be095b6..2e7b6f35fe 100644 --- a/open-sse/executors/codex.ts +++ b/open-sse/executors/codex.ts @@ -1198,6 +1198,21 @@ export class CodexExecutor extends BaseExecutor { }) : [], })); + } else if (!body.input && typeof body.prompt === "string" && body.prompt.trim()) { + // Issue #1872: Cursor occasionally passes the request as `prompt` instead of `messages`. + body.input = [ + { + type: "message", + role: "user", + content: [{ type: "input_text", text: body.prompt }], + }, + ]; + } else if (!body.input && Array.isArray(body.prompt)) { + body.input = body.prompt.map((p: any) => ({ + type: "message", + role: "user", + content: [{ type: "input_text", text: typeof p === "string" ? p : JSON.stringify(p) }], + })); } // ── Cache-aware system prompt handling (both paths) ── diff --git a/open-sse/utils/aiSdkCompat.ts b/open-sse/utils/aiSdkCompat.ts index 91d284bfc1..5f0100b08f 100644 --- a/open-sse/utils/aiSdkCompat.ts +++ b/open-sse/utils/aiSdkCompat.ts @@ -22,8 +22,10 @@ export function resolveStreamFlag(bodyStream: unknown, acceptHeader: unknown): b // Explicit body value always wins if (bodyStream === true) return true; if (bodyStream === false) return false; - // No explicit stream param — fall back to Accept header heuristic - return !clientWantsJsonResponse(acceptHeader); + + // No explicit stream param — default to false per OpenAI spec + // (Fixes #1873 - previously relied on Accept header heuristic) + return false; } /**