Skip to content

Add direct model and reasoning keybindings - #6507

Open
colonelpanic8 wants to merge 1 commit into
pingdotgg:mainfrom
colonelpanic8:feat/direct-model-reasoning-keybindings
Open

Add direct model and reasoning keybindings#6507
colonelpanic8 wants to merge 1 commit into
pingdotgg:mainfrom
colonelpanic8:feat/direct-model-reasoning-keybindings

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Aug 13, 2026

Copy link
Copy Markdown

What Changed

  • Add dynamic model.select.<provider>.<model> keybinding commands.
  • Add dynamic reasoning.select.<effort> keybinding commands.
  • Route both command families through the active composer while preserving other provider options.
  • Add parser and composer-state coverage.

Why

Direct commands let users bind hardware keys or shortcut chords to frequently used models and reasoning levels without opening the model picker.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No visual UI changes
  • Verified direct model selection in the browser
  • 58 focused web tests pass
  • Formatting and lint checks pass for all changed files

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> and reasoning.select.<effort>, with parsers in keybindings.ts. ChatView resolves these before thread-only shortcuts and calls new ChatComposer imperative APIs (selectModel, selectReasoningEffort). Reasoning updates go through selectComposerReasoningEffort, which only applies supported effort values and keeps other model options intact via sticky setProviderModelOptions.

Behavior change: model/reasoning shortcuts can fire when the command palette is closed even if no thread is active (the activeThreadId guard 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

  • Adds two new keybinding command patterns — model.select.<instance>.<model> and reasoning.select.<effort> — to the KeybindingCommand schema in keybindings.ts with validation for length and character constraints.
  • Adds modelSelectTargetFromCommand and reasoningEffortFromCommand parser utilities in keybindings.ts to extract typed targets from matching command strings at runtime.
  • Extends ChatComposerHandle with selectModel and selectReasoningEffort methods that update composer state; reasoning effort changes preserve existing provider option selections and persist sticky state.
  • Updates the global keydown handler in ChatView.tsx to dispatch model and reasoning commands via composerRef, even when no active thread exists — other shortcuts still require an active thread.

Macroscope summarized b4da4b2.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e215c118-2f92-4a91-a837-c77d3f16a8be

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 13, 2026
Comment thread apps/web/src/components/ChatView.tsx Outdated
}

const reasoningEffort = reasoningEffortFromCommand(command);
if (reasoningEffort && composerRef.current?.selectReasoningEffort(reasoningEffort)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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) ?? [];
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit af6c298. Configure here.

@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@colonelpanic8
colonelpanic8 force-pushed the feat/direct-model-reasoning-keybindings branch from af6c298 to b4da4b2 Compare August 13, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant