Repository navigation
fix(responses): warn once when a custom provider drops replayed plaintext reasoning - #6882
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to This adds a one-time warning when a custom Responses provider drops replayed plaintext reasoning. Request behavior is unchanged, and no merge-blocking risk was found. Pre-merge checks |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6300750e5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return PROVIDER_REGISTRY.some(entry => | ||
| normalizedProviderEndpoint(entry.baseUrl) === endpoint | ||
| || (entry.destinationAliases ?? []).some(alias => normalizedProviderEndpoint(alias.baseUrl) === endpoint)); |
There was a problem hiding this comment.
Warn custom providers on vLLM's default URL
When a hand-configured openai-responses provider uses vLLM's standard http://localhost:8000/v1 endpoint, this URL-only scan matches the unrelated, chat-only, overrideable vllm registry row in src/providers/registry/entries-core.ts:1201; isCustomResponsesProvider therefore returns false even while the serializer blanks nonempty reasoning content. This suppresses the newly documented warning for one of the feature's primary self-hosted scenarios, so the exemption should be restricted to registry entries with a curated Responses contract rather than every registry row sharing the URL.
Useful? React with 👍 / 👎.
| stripEncryptedContent: threadServingIdentityChanged || requiresPlaintextReasoningReplay(provider), | ||
| dropForeignItemId: parsed._dropForeignReasoningItemIds === true, | ||
| requirePlaintextReasoning: requiresPlaintextReasoningReplay(provider), | ||
| onPlaintextReasoningBlanked: () => notePlaintextReasoningDropped(provider), |
There was a problem hiding this comment.
Update the owned structure contract for the warning
This callback adds new process-wide, user-visible adapter behavior and provider-classification rules, but the commit updates no mapped structure/ document; for example, structure/providers/chat-compat.md already describes the reasoning-input sanitization contract and now omits its warning and exemption behavior. Update the adapter area's owned structure documentation in the same change so the maintainer contract remains synchronized.
AGENTS.md reference: src/AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
…s in the reasoning notice
|
✅ Deterministic PR hygiene checks passed. |
Summary
A hand-configured
openai-responsesprovider (for example Kimi K3 on vLLM, #6675) silently sends replayed plaintext reasoning ascontent: []unless it setspreserveResponsesReasoningContent: true. That default is intentional and stays: the ChatGPT backend rejects echoed raw reasoning, and #2229 / #2258 recorded the token and privacy cost of forwarding it. What was missing is any sign that it happened, and the similarly namedpreserveReasoningContentModelslooks like the right switch but only affects the Chat wire.The serializer now reports when it blanks nonempty
reasoning_text, and the passthrough adapter logs one warning per destination host the first time that happens for a custom provider:The warning names only the host and option names, never request content. It is skipped for registry presets (matched by endpoint on either OpenAI wire, and by host pattern for the templated Azure preset), Azure OpenAI / AI Foundry per-resource hosts, OAuth and forward rows, Chat-wire rows, and OpenAI-operated destinations, where the blanking is a curated decision. Remembered hosts are capped at 64. The request body is unchanged in every case. The provider configuration reference now mentions the warning, the Kimi/vLLM case, and that the Chat-wire option does not apply.
This addresses the "warn when reasoning is discarded" follow-up on #6675. Surfacing the option in the custom-provider setup UI is left out, so the issue should stay open for that part.
Refs #6675
Verification
bun test tests/providers/deepseek-reasoning-replay.test.ts: 23 pass. New cases: the sanitizer reports only nonempty plaintext blanking (not preserved, empty, or empty-text items); a custom destination warns once with no request content; OpenAI, a registry preset routed to Responses (OpenGateway), forward, OAuth, Chat-wire rows and hand-configured Azure hosts (*.openai.azure.com,*.services.ai.azure.com,*.cognitiveservices.azure.com) stay silent, while a lookalike host outside Azure still warns; the passthrough serializer still blanks and emits exactly one notice, and a preserving provider keeps the text without a notice.bun teston the five other suites that exercise reasoning replay through passthrough (openai-responses-passthrough,chat-inbound-reasoning-replay,claude-native-reasoning-continuity,anthropic-thinking-signature,alibaba-token-plan-wire-defaults): 265 pass.bun x tsc --noEmit: exit 0.Checklist
Summary by CodeRabbit