Skip to content

fix(sse): default reasoning summary for effort-only Responses requests - #6807

Merged
diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.47from
rushsinging:fix/openai-responses-reasoning-summary
Jul 12, 2026
Merged

diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.47from
rushsinging:fix/openai-responses-reasoning-summary

Conversation

@rushsinging

Copy link
Copy Markdown
Contributor

Problem

A Chat-Completions client (e.g. an OpenAI-format coding agent) can only express reasoning through the top-level reasoning_effort hint — it has no way to request a reasoning summary. When such a request is routed to an openai-compatible provider node running with apiType: responses, openaiToOpenAIResponsesRequest promotes reasoning_effort to the Responses API's reasoning.effort but 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 DefaultExecutor path lacks the summary/include injection that the Codex executor already performs via ensureCodexReasoningSummary.

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:

  • Only the effort-only path (a chat client that sent top-level reasoning_effort). An explicit reasoning object from a Responses-shaped client is preserved untouched.
  • reasoning_effort: "none" is left without a summary.
  • A client-provided include is preserved (idempotent).

Tests

tests/unit/translator-openai-responses-req.test.ts and tests/unit/openai-responses-reasoning-effort.test.ts:

  • effort-only request → reasoning: { effort, summary: "auto" } + include: ["reasoning.encrypted_content"]
  • reasoning_effort: "none" → no summary, no include
  • existing "preserves explicit reasoning objects" and "does not inject include when caller did not set one" behavior stays unchanged

All 53 tests in the two suites pass; typecheck:core is clean; lint / any-budget gates pass.

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@diegosouzapw

Copy link
Copy Markdown
Owner

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 ensureCodexReasoningSummary pattern well. No changes requested; this looks merge-ready.

diegosouzapw added a commit that referenced this pull request Jul 12, 2026
…nslator test 1195)

Owner-approved /merge-prs tail freeze. localDb.ts is re-export-only (Hard Rule #2);
translator test grew from #6807's regression suite. Both frozen (shrink-only).
@diegosouzapw
diegosouzapw merged commit 1080797 into diegosouzapw:release/v3.8.47 Jul 12, 2026
3 checks passed
@diegosouzapw diegosouzapw mentioned this pull request Jul 13, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…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).
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
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>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…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).
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants