Repository navigation
[Feat] Add reasoning-effort quick switcher to the chat input - #2634
zoomote[bot] wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
Review statusThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging. Current step: Mark the PR ready. Required CI must pass before CodeRabbit starts. Review-state labels are managed by this workflow; do not edit them manually. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes: # (no issue exists yet for this request; it came from a Discord community question. A maintainer can link the approved issue here.)
Related PRs
Description
A community member asked for a way to switch the reasoning effort of a model in the editor without editing settings or creating new profiles. This PR adds a reasoning-effort quick switcher to the chat input footer, next to the mode selector.
Key implementation details:
useSelectedModelcapability data. It renders only when the active model exposessupportsReasoningEffort. The menu offers Default plus exactly the efforts the model supports, so unsupported values are never selectable.reasoningEffortOverride(added tobaseProviderSettingsShape, so every provider carries it). It never rewrites the profile's savedreasoningEffortorenableReasoningEffortvalues.buildApiHandlerfolds the override into the effective settings through a newwithReasoningEffortOverridehelper. This single point covers streaming, non-streaming, and SSE-fallback request paths for all providers, including the OpenAI-compatible and native OpenAI handlers. The OpenAI-compatible handler now prefers the override over the custom model info effort; without an override, request shapes stay byte-identical to before.updateProfileModelmutation, so a new model never inherits an effort it may not support.persistProviderProfile, andupdateTaskApiHandlerIfNeededmachinery, so it applies to the next request of the current task and survives restarts.chat-text-area-reasoning-effort) covers the rendered control.Anything reviewers must check with care:
visual-regression.ymlcontainer after this PR opens, per the fallback inwebview-ui/AGENTS.md.Test Procedure
pnpm test(full turbo suite),pnpm check-types, andpnpm lintpass. Note: the twoextension.spec.tsfocus-tracker tests failed once under full turbo parallelism, but they pass consistently in isolation and in the standalonesrcsuite run; the failure signature is unrelated to this diff.src/api/providers/__tests__/openai.spec.ts(override honored on streaming and non-streaming, override beats custom model info, "disable" omits reasoning, out-of-capability override falls back to the model default, no reasoning for models without support) andsrc/api/providers/__tests__/openai-native.spec.ts(override honored, capability fallback, required-model default, unchanged shapes without support).ClineProvider.apiHandlerRebuild.spec.ts(override stored without rewriting the configured effort, clear on null, invalid value rejected, provider mismatch rejected, task handler rebuilt, override cleared on model change) andwebviewMessageHandler.spec.ts(message validation).ReasoningEffortSelector.spec.tsx(hidden without capability or profile, active-effort label, exact menu contents, override indicator, message payloads, "Off" labeling, unsupported override ignored).Pre-Submission Checklist
src/test-utils/,@/utils/test-utils) are used only for mechanical duplication; test intent and scenario-specific mocks remain visible.*.visual.tsxsnapshot inwebview-ui/. Seewebview-ui/AGENTS.md→ "When a UI change needs a snapshot".Visual Snapshots
ChatTextArea.visual.tsxgains achat-text-area-reasoning-effortgallery test with resting and open-menu snapshots per theme. The committed container baselines follow via thevisual-regression.ymlfallback (see Description). Review-aid captures of the shipped control (footer trigger, open menu, override indicator) are in the paired docs PR.Videos (interaction / animation only)
Not needed. The interaction is a standard pop-up menu; the open-menu snapshots cover the end state.
Documentation Updates
Additional Notes
Providers and models without reasoning-effort capability are unaffected: the control stays hidden and the request shapes are unchanged. For models whose capability array includes
disable(for example some Z.ai models), the menu shows an Off entry that turns reasoning off, mirroring the settings page semantics.Get in Touch
@roomote (working on behalf of Toray Altas)