Skip to content

feat(tui): shortcuts to change reasoning level temporarily#18866

Merged
fcoury-oai merged 6 commits intomainfrom
fcoury/reasoning-level-keybindings
Apr 21, 2026
Merged

feat(tui): shortcuts to change reasoning level temporarily#18866
fcoury-oai merged 6 commits intomainfrom
fcoury/reasoning-level-keybindings

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai commented Apr 21, 2026

Summary

Adds main-chat shortcuts for changing reasoning effort one step at a time:

  • Alt+, lowers reasoning (has the < arrow on the key)
  • Alt+. raises reasoning (similarly, has the > arrow)

The shortcut updates the active session only. It does not persist the selected reasoning level as the default for future sessions. In Plan mode, it applies temporarily to Plan mode without opening the global-vs-Plan scope prompt.

Details

The shortcut uses the active model preset to decide which reasoning levels are valid. If the current session has no explicit reasoning effort, it starts from the model default. Each keypress moves to the next supported level in the requested direction.

The shortcut only runs from the main chat surface. If a popup or modal is open, input remains owned by that UI.

In Plan mode, the shortcut updates the in-memory Plan reasoning override directly. The model/reasoning picker still keeps the existing scope prompt for explicit picker changes.

Notes

Ctrl-plus and Ctrl-minus were considered, but terminals do not deliver those combinations consistently, so this PR uses Alt shortcuts instead.

If the current effort is unsupported by the selected model, the shortcut skips to the nearest supported level in the requested direction. If there is no valid step, it shows the existing boundary message.

Tests

  • cargo test -p codex-tui reasoning_shortcuts
  • cargo test -p codex-tui reasoning_effort
  • cargo test -p codex-tui reasoning_shortcut
  • cargo test -p codex-tui footer_snapshots
  • cargo test -p codex-tui
  • just fix -p codex-tui
  • ./tools/argument-comment-lint/run.py -p codex-tui -- --tests

@fcoury-oai fcoury-oai force-pushed the fcoury/reasoning-level-keybindings branch from 090d214 to 803c989 Compare April 21, 2026 17:53
@fcoury-oai fcoury-oai force-pushed the fcoury/reasoning-level-keybindings branch from 803c989 to 3858b4c Compare April 21, 2026 17:56
@fcoury-oai fcoury-oai changed the title Add reasoning level shortcuts feat(tui): shortcuts to change reasoning level temporarily Apr 21, 2026
@fcoury-oai fcoury-oai marked this pull request as ready for review April 21, 2026 18:56
Copy link
Copy Markdown
Contributor

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

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: 46c97c4840

ℹ️ 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 codex-rs/tui/src/chatwidget.rs
@canvrno-oai
Copy link
Copy Markdown
Contributor

Tested and confirmed that alt keys adjust thinking level

@fcoury-oai fcoury-oai enabled auto-merge (squash) April 21, 2026 20:10
@fcoury-oai fcoury-oai disabled auto-merge April 21, 2026 20:23
@fcoury-oai fcoury-oai merged commit e502f0b into main Apr 21, 2026
25 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/reasoning-level-keybindings branch April 21, 2026 21:04
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants