Repository navigation
[AISAGE-759] fix(ai-gateway): drop non-OpenAI reasoning fields on ChatGPT route - #8560
Conversation
…ChatGPT route OpenRouter's reasoning extensions (enabled, exclude, max_tokens) and OpenAI's deprecated generate_summary are rejected as unknown parameters.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe two-file change deletes OpenRouter-only and deprecated reasoning fields from delegated ChatGPT Responses requests, and the new tests cover both a mixed reasoning object and an absent one; I found no defects in the changed lines. Assumptions: Files Reviewed (2 files)
Reviewed by deepseek-flash-latest · Input: 60.7K · Output: 15.2K · Cached: 1.3M Review guidance: REVIEW.md from base branch |
Summary
This follows up #8555. On the ChatGPT route, the delegated transform now removes reasoning fields that api.openai.com rejects with
400 unknown_parameter:reasoning.enabled,reasoning.excludeandreasoning.max_tokensare OpenRouter's own reasoning settings, documented in OpenRouter's reasoning tokens docs. OpenAI'sReasoningtype has none of them. Clients that are set up for OpenRouter send them.reasoning.generate_summary: the OpenAI SDK marks it "Deprecated: usesummaryinstead", and the API now rejects it. Dropping it loses nothing, because the gateway already setsreasoning.summaryon every Responses request (enableReasoningSummaries).effort,summary,contextandmodeare passed through unchanged. Tracked in AISAGE-759.Verification
reasoning.enabledandreasoning.generate_summaryare both rejected asunknown_parameter.excludeandmax_tokenswere not seen there, but they are part of the same OpenRouter settings and OpenAI'sReasoningtype does not include them.openai-chatgpt/suites with a new transform test; all pass.pnpm --filter @kilocode/web-shared typecheckand oxlint on the changed files; both are clean.Visual Changes
N/A
Reviewer Notes
enabled: falsenow gets the model's default effort instead of an error. Translating it toeffort: "none"would fail on models that rejectnone, for example gpt-6-astra.