fix: only send OpenAI reasoning params for models that support them#227
Merged
Conversation
buildResponsesRequest sent `reasoning: { summary }` unconditionally, and
non-reasoning API-key models reject it (gpt-4.1 → 400 Unsupported parameter:
'reasoning.summary'). Found embedding Heddle in a host whose default model is
gpt-4.1; the CLI never hit it because it defaults to gpt-5.x.
Now the reasoning block is included only when oauthMode is on (the account
sign-in allowlist is reasoning models and that path expects summary auto), a
reasoning effort resolved, or the model is reasoning-capable per model policy.
Adds codec unit tests for gpt-4.1 (omitted), gpt-5.4 API-key (detailed +
default effort), OAuth (auto), and codex-family API-key/OAuth.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CjFdZgZhov8wdwFinVTfjz
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87d3bbbf3b
ℹ️ 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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
OpenAiCodec.buildResponsesRequestsentreasoning.summaryon every request. Non-reasoning API-key models reject it:This surfaced in an embedded host whose default model is
gpt-4.1.Fix
Model policy now treats reasoning summaries and configurable reasoning effort as separate capabilities:
summary: 'auto'behavior.summary: 'detailed'in API-key mode.reasoningblock.This follows the Responses API contract, where reasoning configuration is model-specific and summary support is not equivalent to Heddle's narrower effort-selection UI.
Review follow-up
Addresses the review finding that the first implementation dropped summaries for o-series models. Coverage also protects older GPT-5 and Codex API-key models from the same regression.
Verification
yarn lintyarn build