feat: make reasoning effort/summaries configurable #1199
Merged
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.
Previous to this PR, we always set
reasoning
when making a request using the Responses API:codex/codex-rs/core/src/client.rs
Lines 108 to 111 in d7245cb
Though if you tried to use the Rust CLI with
--model gpt-4.1
, this would fail with:"Unsupported parameter: 'reasoning.effort' is not supported with this model."
We take a cue from the TypeScript CLI, which does a check on the model name:
codex/codex-cli/src/utils/agent/agent-loop.ts
Lines 786 to 789 in d7245cb
This PR does a similar check, though also adds support for the following config options:
This way, if you have a model whose name happens to start with
"o"
(or"codex"
?), you can set these to"none"
to explicitly disable reasoning, if necessary. (That said, it seems unlikely anyone would use the Responses API with non-OpenAI models, but we provide an escape hatch, anyway.)This PR also updates both the TUI and
codex exec
to showreasoning effort
andreasoning summaries
in the header.