Add direct model and reasoning keybindings - #6507
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| } | ||
|
|
||
| const reasoningEffort = reasoningEffortFromCommand(command); | ||
| if (reasoningEffort && composerRef.current?.selectReasoningEffort(reasoningEffort)) { |
There was a problem hiding this comment.
🟡 Medium components/ChatView.tsx:4792
A recognized reasoning.select.* shortcut is not consumed when selectReasoningEffort returns false or the composer ref is unavailable, so the key event reaches the browser/OS (for example, Cmd+R reloads the app). Consume the recognized command before attempting the selection, matching the model.select.* behavior.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/ChatView.tsx around line 4792:
A recognized `reasoning.select.*` shortcut is not consumed when `selectReasoningEffort` returns `false` or the composer ref is unavailable, so the key event reaches the browser/OS (for example, `Cmd+R` reloads the app). Consume the recognized command before attempting the selection, matching the `model.select.*` behavior.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit af6c298. Configure here.
| : descriptor, | ||
| ); | ||
| return buildProviderOptionSelectionsFromDescriptors(nextDescriptors) ?? []; | ||
| } |
There was a problem hiding this comment.
Reasoning shortcut skips ultrathink
High Severity
selectComposerReasoningEffort only rewrites the primary select option and never mirrors TraitsPicker prompt-injection handling. For Claude, reasoning.select.ultrathink does not inject the prompt prefix, and shortcuts away from ultrathink leave an Ultrathink: prompt in place, so the UI and sent turn stay stuck in ultrathink.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit af6c298. Configure here.
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. This PR introduces new user-facing keyboard shortcuts for model and reasoning selection, which warrants human review as new capability. Additionally, there is an unresolved high-severity comment identifying that the reasoning shortcuts bypass ultrathink prompt-injection handling, causing UI/state inconsistency, and a medium-severity finding about unconsumed key events. You can customize Macroscope's approvability policy. Learn more. |
af6c298 to
b4da4b2
Compare


What Changed
model.select.<provider>.<model>keybinding commands.reasoning.select.<effort>keybinding commands.Why
Direct commands let users bind hardware keys or shortcut chords to frequently used models and reasoning levels without opening the model picker.
Checklist
Note
Low Risk
Composer and keybinding wiring only; no auth or data-path changes, with validation and unit tests for parsers and reasoning selection.
Overview
Adds direct keybindings so users can switch provider/model and reasoning effort without opening the model picker.
New command shapes are validated in contracts:
model.select.<instanceId>.<model>andreasoning.select.<effort>, with parsers inkeybindings.ts. ChatView resolves these before thread-only shortcuts and calls new ChatComposer imperative APIs (selectModel,selectReasoningEffort). Reasoning updates go throughselectComposerReasoningEffort, which only applies supported effort values and keeps other model options intact via stickysetProviderModelOptions.Behavior change: model/reasoning shortcuts can fire when the command palette is closed even if no thread is active (the
activeThreadIdguard no longer blocks them).Reviewed by Cursor Bugbot for commit b4da4b2. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add direct model and reasoning effort keybindings to the chat composer
model.select.<instance>.<model>andreasoning.select.<effort>— to theKeybindingCommandschema in keybindings.ts with validation for length and character constraints.modelSelectTargetFromCommandandreasoningEffortFromCommandparser utilities in keybindings.ts to extract typed targets from matching command strings at runtime.ChatComposerHandlewithselectModelandselectReasoningEffortmethods that update composer state; reasoning effort changes preserve existing provider option selections and persist sticky state.composerRef, even when no active thread exists — other shortcuts still require an active thread.Macroscope summarized b4da4b2.