fix(sse): default reasoning summary for effort-only Responses requests - #6807
Conversation
A Chat-Completions client can only express reasoning via the top-level reasoning_effort hint and has no way to request a reasoning summary. When that hint is promoted to the Responses API's reasoning.effort, the upstream returns an empty summary and downstream chat clients see no thinking stream (encrypted reasoning only). Default reasoning.summary "auto" plus include ["reasoning.encrypted_content"] on the effort-only path so the summary actually streams back to the chat client, mirroring the Codex executor's ensureCodexReasoningSummary. An explicit reasoning object from a Responses-shaped client is preserved untouched, and reasoning_effort "none" is left without a summary. Adds regression tests for the effort-only default, the none case, and keeps the existing explicit-reasoning-object behavior unchanged.
There was a problem hiding this comment.
Code Review
This pull request updates the translator logic to default a reasoning summary (summary: "auto") and include the encrypted reasoning content (reasoning.encrypted_content) when converting effort-only Chat Completion requests to Responses API requests. This ensures that the upstream streams thinking back to the chat client. It also updates existing tests and adds a new test to verify that a reasoning summary is not defaulted when reasoning_effort is set to "none". There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Thanks for the clean, narrowly-scoped fix — verified locally: all 53 tests in the two touched suites pass, and reverting just the translator change makes 2 of them fail exactly as expected (empty summary), confirming the test genuinely proves the bug. Mirrors the Codex executor's |
…diegosouzapw#6807 (translator test 1195) Owner-approved /merge-prs tail freeze. localDb.ts is re-export-only (Hard Rule #2); translator test grew from diegosouzapw#6807's regression suite. Both frozen (shrink-only).
diegosouzapw#6807) A Chat-Completions client can only express reasoning via the top-level reasoning_effort hint and has no way to request a reasoning summary. When that hint is promoted to the Responses API's reasoning.effort, the upstream returns an empty summary and downstream chat clients see no thinking stream (encrypted reasoning only). Default reasoning.summary "auto" plus include ["reasoning.encrypted_content"] on the effort-only path so the summary actually streams back to the chat client, mirroring the Codex executor's ensureCodexReasoningSummary. An explicit reasoning object from a Responses-shaped client is preserved untouched, and reasoning_effort "none" is left without a summary. Adds regression tests for the effort-only default, the none case, and keeps the existing explicit-reasoning-object behavior unchanged. Co-authored-by: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com>
…diegosouzapw#6807 (translator test 1195) Owner-approved /merge-prs tail freeze. localDb.ts is re-export-only (Hard Rule diegosouzapw#2); translator test grew from diegosouzapw#6807's regression suite. Both frozen (shrink-only).
diegosouzapw#6807) A Chat-Completions client can only express reasoning via the top-level reasoning_effort hint and has no way to request a reasoning summary. When that hint is promoted to the Responses API's reasoning.effort, the upstream returns an empty summary and downstream chat clients see no thinking stream (encrypted reasoning only). Default reasoning.summary "auto" plus include ["reasoning.encrypted_content"] on the effort-only path so the summary actually streams back to the chat client, mirroring the Codex executor's ensureCodexReasoningSummary. An explicit reasoning object from a Responses-shaped client is preserved untouched, and reasoning_effort "none" is left without a summary. Adds regression tests for the effort-only default, the none case, and keeps the existing explicit-reasoning-object behavior unchanged. Co-authored-by: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com>
Problem
A Chat-Completions client (e.g. an OpenAI-format coding agent) can only express reasoning through the top-level
reasoning_efforthint — it has no way to request a reasoning summary. When such a request is routed to anopenai-compatibleprovider node running withapiType: responses,openaiToOpenAIResponsesRequestpromotesreasoning_effortto the Responses API'sreasoning.effortbut never sets a summary.As a result the Responses upstream returns an empty reasoning summary, so the downstream chat client sees no thinking stream at all (only encrypted reasoning that never surfaces). The generic
DefaultExecutorpath lacks the summary/include injection that the Codex executor already performs viaensureCodexReasoningSummary.Fix
In
openaiToOpenAIResponsesRequest, on the effort-only path, default:reasoning.summary: "auto"include: ["reasoning.encrypted_content"]so the summary actually streams back to the client. This generalizes what the Codex executor already does to any openai-compatible → Responses translation.
Scope is deliberately narrow:
reasoning_effort). An explicitreasoningobject from a Responses-shaped client is preserved untouched.reasoning_effort: "none"is left without a summary.includeis preserved (idempotent).Tests
tests/unit/translator-openai-responses-req.test.tsandtests/unit/openai-responses-reasoning-effort.test.ts:reasoning: { effort, summary: "auto" }+include: ["reasoning.encrypted_content"]reasoning_effort: "none"→ no summary, no includeAll 53 tests in the two suites pass;
typecheck:coreis clean; lint / any-budget gates pass.