Skip to content

fix(core): use runtime config for review reasoning effort - #12630

Closed
hdcodedev wants to merge 1 commit into
openai:mainfrom
hdcodedev:fix/12495-review-runtime-reasoning-effort
Closed

fix(core): use runtime config for review reasoning effort#12630
hdcodedev wants to merge 1 commit into
openai:mainfrom
hdcodedev:fix/12495-review-runtime-reasoning-effort

Conversation

@hdcodedev

@hdcodedev hdcodedev commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

What

Fix /review so it uses the active runtime turn context when selecting model config, especially reasoning effort, instead of relying on potentially stale startup config.

Why

Fixes #12495. After switching model/effort in-session (for example to gpt-5.1-codex-mini + high), /review could still use startup effort (for example xhigh) and fail with unsupported-effort errors.

How

Updated review flow in core/src/codex.rs:

  • Review now derives config from parent_turn_context.config instead of startup config.
  • Added a shared helper, select_reasoning_effort_for_model(...), and reused it in both model switching and review.
  • Review now sets per_turn_config.model_reasoning_effort from that helper, preserving current runtime effort when supported and falling back when not.

Testing

Added/updated coverage in core/tests/suite/review.rs:

  • review_uses_current_reasoning_effort_after_model_switch
  • review_falls_back_reasoning_effort_when_current_effort_is_unsupported

Validation run:

  • cargo clippy -p codex-core --tests
  • cargo test -p codex-core

Before fix

issue.mp4

After fix

TODO

Use parent turn context config in /review instead of startup config, so review
model resolution and reasoning effort come from current runtime state.
Recompute review reasoning effort against the selected review model and
fallback when the current effort is unsupported.

Add review tests for:
- using current runtime effort after model switch
- falling back to supported effort when runtime effort is unsupported
@etraut-openai

Copy link
Copy Markdown
Contributor

We've updated our contribution guidelines to indicate that we're no longer accepting unsolicited code contributions. All code contributions are by invitation only. To read more about why we've taken this step, please refer to this announcement.

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.

/review can submit stale reasoning.effort after switching to gpt-5.1-codex-mini

2 participants