Skip to content

fix(proxy): request reasoning summaries for Responses providers - #297

Draft
jay23606 wants to merge 4 commits into
GoDiao:mainfrom
jay23606:pr-go/295-responses-format-providers-show-no-think
Draft

jay23606 wants to merge 4 commits into
GoDiao:mainfrom
jay23606:pr-go/295-responses-format-providers-show-no-think

Conversation

@jay23606

@jay23606 jay23606 commented Nov 21, 2026 •

Copy link
Copy Markdown

Problem

With a provider in the OpenAI Responses format, the model thinks but the conversation shows no thinking text. The proxy sent reasoning: { effort } only and never asked for reasoning.summary, so Responses returned reasoning items with an empty summary and only encrypted_content.

Change

When thinking is on, the responses_reasoning dialect now sends reasoning: { effort, summary: "auto" }. The request type allows the optional summary field. P-REQ-08 and the model-rules documentation now distinguish the reasoning replay added in #264 from the summary request in this PR. The CHANGELOG describes the visible result.

Testing

  • bun test src/services/openaiAuth/fetch.test.ts src/server/__tests__/proxy-model-rules.test.ts --randomize --seed=1: 65 passed, 0 failed.
  • Full bun test on Windows with Bun 1.4.5, frozen root and vendor/showai dependencies, and the pinned ripgrep prepared: 3,387 passed, 27 skipped, 10 failed (3,424 tests, 252.69 seconds). The failures were in artifact/deck path and symlink-boundary tests, CLI environment/session startup tests, the deck-edit integration test, and a Claude billing-attribution test. I have not established whether these failures reproduce on Linux. The PR checks currently report GitGuardian success; hosted project test checks are not reported yet.

Responses compatibility checks

The non-streaming measurements reported in #295 (2026-11-20) found that a third-party GPT-6 Luna gateway returned encrypted_content for all requests and produced summary text for a multi-step task with summary: "auto", but not for a short task. OpenRouter returned HTTP 200 for GPT-5 mini and Claude Haiku with summary: "auto"; GPT-5 mini returned summary text, while Claude Haiku returned reasoning content with or without the parameter. Those measurements predate this PR and were not repeated here.

This environment has no OpenRouter API key, so live streaming, replaying a reasoning item containing both summary and encrypted_content, and compatibility with other Responses endpoints remain unverified. The automated tests cover streamed summary conversion and replay serialization. No rejection has been observed that would require making the summary field configurable.

Fixes #295

@GoDiao GoDiao left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @jay23606, and welcome to DreamCoder! The change itself is right: with thinking on, responses_reasoning now sends reasoning: { effort, summary: "auto" }, a model that can turn thinking off still gets only { effort: "none" }, and the response side already turns summaries into thinking blocks (openaiResponsesStreamToAnthropic.ts:332-345 for streaming, openaiResponsesToAnthropic.ts without streaming, reasoningReplay.ts for the next turn). Reverting requestRules.ts fails both updated tests. A few things before we merge.

Must fix

CI fails on this PR. The ChatGPT subscription path builds its request through the same rules and the same Responses transform (src/services/openaiAuth/fetch.ts:37-45), so it now sends summary: "auto" too, and src/services/openaiAuth/fetch.test.ts:119 still expects { effort: 'high' }. Sending the summary there is right: Codex itself sends summary whenever the model supports it, with auto as the default (codex-rs/core/src/client.rs, build_reasoning). Please update that expectation, and run the full bun test before pushing; the PR only ran proxy-model-rules.test.ts.

Should fix

1. Run the checks #295 lists under "To check before implementing", and put the results in the PR description. #295 measured only non-streaming requests, so before we change every Responses provider we'd like to see:

  • a streamed request with summary: "auto" showing summary text arriving as thinking;
  • a second turn that replays the reasoning item with both summary and encrypted_content, accepted by the upstream;
  • what other Responses-compatible endpoints do with reasoning.summary: accept, ignore or reject.

You don't need a paid key for this: OpenRouter's Responses endpoint (/api/v1/responses) has free models (the :free ones, several of which support reasoning, for example the Nemotron and Gemma models). For OpenAI directly, the Codex behaviour above is enough for us unless you have an OpenAI key to check the organization-verification case. If any of these rejects the field, say so; the summary would then need to be a rule a site or user can turn off rather than a fixed field.

2. model-rules.md still describes the old request. The dialect table (docs/features/harness/model-rules.md:458) shows reasoning:{effort:L} for responses_reasoning, and item 6 of the reasoning replay section (around line 750) says reasoning summaries are not requested. P-REQ-08 now points readers to that section, so the two contradict each other.

3. P-REQ-08's status line. The new sentence follows "已在 #264 修复:…", so it reads as if #264 added the summary. Please say what each PR did, e.g. #264 added include, #297 requests reasoning.summary: "auto".

4. CHANGELOG. #295 is a bug, so the entry fits under ### Fixed. It should reference the PR and end with a thank-you like the other external entries: (#297). Thanks @jay23606. Please describe what the user sees ("only a signature" isn't visible to them), for example: "Providers in the OpenAI Responses format show the model's thinking in the conversation instead of none."

Notes

  • A model whose thinking can't be turned off (e.g. gpt-6.1-sol, per proxy-model-rules.test.ts:144) now requests a summary even when the user turned thinking off. That's fine, but "when thinking is on" in the CHANGELOG and status line isn't quite accurate.
  • The "Regression test: …" line at the end of the PR description repeats the Testing section; please drop it.

@jay23606
jay23606 force-pushed the pr-go/295-responses-format-providers-show-no-think branch from bea71bd to 8b06751 Compare November 22, 2026 04:21
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
@jay23606
jay23606 marked this pull request as draft November 22, 2026 05:04
@jay23606

Copy link
Copy Markdown
Author

This round changed item 4 of the 现状 list in docs/features/harness/proxy/transport.md, which said Responses requests do not set reasoning.summary; it now says they set summary: "auto" when thinking is on. The fetch.test.ts:119 expectation, the model-rules.md dialect table and replay item 6, the P-REQ-08 status line and the CHANGELOG entry already read as requested, and the focused tests pass. The live OpenRouter checks were not run because no OpenRouter key is available in this environment, and the full bun test run fails on this Windows checkout from missing modules (@dagrejs/dagre, katex) and tar errors.

@jay23606

Copy link
Copy Markdown
Author

No code changed in this round. The CI expectation at src/services/openaiAuth/fetch.test.ts:119 already reads { effort: 'high', summary: 'auto' }, and the two focused test files pass (65 passed, 0 failed). The model-rules table, item 6, the P-REQ-08 status line and the CHANGELOG entry already carry the wording you asked for. I could not run the streamed, replay or other-endpoint checks here because this environment has no OpenRouter key, so the PR description still lists them as unverified.

This branch has not been deployed

No deployments
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.

Responses-format providers show no thinking: the proxy does not request reasoning summaries

2 participants