Skip to content

fix: only send OpenAI reasoning params for models that support them#227

Merged
roackb2 merged 2 commits into
mainfrom
fix/openai-reasoning-non-reasoning-models
Jul 9, 2026
Merged

fix: only send OpenAI reasoning params for models that support them#227
roackb2 merged 2 commits into
mainfrom
fix/openai-reasoning-non-reasoning-models

Conversation

@roackb2

@roackb2 roackb2 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Bug

OpenAiCodec.buildResponsesRequest sent reasoning.summary on every request. Non-reasoning API-key models reject it:

LLM error: 400 Unsupported parameter: 'reasoning.summary' is not supported with the 'gpt-4.1-2025-04-14' model.

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:

  • OAuth requests retain their existing summary: 'auto' behavior.
  • Curated GPT-5, Codex, and o-series reasoning models retain summary: 'detailed' in API-key mode.
  • A reasoning effort is included only when Heddle has an explicit supported effort for that model.
  • Non-reasoning and unknown API-key models omit the entire reasoning block.
  • Dated snapshots of curated reasoning models inherit the corresponding summary capability.

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

  • Unit: 610 passed
  • Integration: 285 passed
  • yarn lint
  • yarn build

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/core/llm/adapters/openai/openai-codec.ts Outdated
@roackb2 roackb2 merged commit ce767b3 into main Jul 9, 2026
5 checks passed
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.

1 participant