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
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
fix(openai-responses): propagate include so chat clients stream reasoning summaries (#2154)
Gioxafca89049c901
diff --git a/open-sse/translator/request/openai-responses.ts b/open-sse/translator/request/openai-responses.tsindex aa9a981a5a..45beee74b0 100644--- a/open-sse/translator/request/openai-responses.ts+++ b/open-sse/translator/request/openai-responses.ts@@ -568,6 +568,14 @@ export function openaiToOpenAIResponsesRequest(result.reasoning = { effort };}}++ // Propagate Responses-API-only fields when a chat client sent them.+ // Without this, e.g. `include: ["reasoning.encrypted_content"]` is lost on+ // the way upstream and Codex returns an empty reasoning summary, so clients+ // (OpenCode, Cursor, etc.) see no thinking stream.+ if (Array.isArray(root.include) && root.include.length > 0) {+ result.include = root.include;+ }if (storeEnabled) {if (root[RESPONSES_STORE_MARKER] !== undefined) {result.store = root[RESPONSES_STORE_MARKER];diff --git a/tests/unit/translator-openai-responses-req.test.ts b/tests/unit/translator-openai-responses-req.test.tsindex e8004c3e6c..e66c4c7469 100644--- a/tests/unit/translator-openai-responses-req.test.ts+++ b/tests/unit/translator-openai-responses-req.test.ts@@ -297,6 +297,35 @@ test("Chat -> Responses preserves explicit reasoning objects", () => {assert.equal((result as any).store, false);});+test("Chat -> Responses propagates include so upstream streams the reasoning summary", () => {+ const result = openaiToOpenAIResponsesRequest(+ "gpt-5.3-codex-spark",+ {+ messages: [{ role: "user", content: "Hello" }],+ reasoning: { effort: "high", summary: "auto" },+ include: ["reasoning.encrypted_content"],+ },+ false,+ null+ );++ assert.deepEqual((result as any).include, ["reasoning.encrypted_content"]);+});++test("Chat -> Responses does not inject include when caller did not set one", () => {+ const result = openaiToOpenAIResponsesRequest(+ "gpt-5.3-codex-spark",+ {+ messages: [{ role: "user", content: "Hello" }],+ reasoning: { effort: "high" },+ },+ false,+ null+ );++ assert.equal((result as any).include, undefined);+});+test("Chat -> Responses maps reasoning_effort into Responses reasoning", () => {const result = openaiToOpenAIResponsesRequest("gpt-5.3-codex-spark",