Skip to content

fix(ThinkingBudget): support xhigh and all extended reasoning effort values (#713)#774

Merged
edelauna merged 3 commits into
mainfrom
issue/713
Jul 1, 2026
Merged

fix(ThinkingBudget): support xhigh and all extended reasoning effort values (#713)#774
edelauna merged 3 commits into
mainfrom
issue/713

Conversation

@edelauna

@edelauna edelauna commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #713

Description

The Model Reasoning Effort dropdown in settings was typed against ReasoningEffortWithMinimal (minimal | low | medium | high), which excluded xhigh, max, none, and disable — even though these values were already present in the model capability arrays (e.g. GPT-5.5 advertises ["none","low","medium","high","xhigh"]). At runtime the dropdown happened to render them via the array path, but the types were lying and .includes("disable" as any) masked the gap.

How:

  • Replaced ReasoningEffortWithMinimal with ReasoningEffortOption (ReasoningEffortExtended | "disable") as the type for baseAvailableOptions, removing all unsafe casts including as any.
  • Removed the now-unused ReasoningEffortWithMinimal import.
  • Updated the top-of-file semantics doc comment to reflect the full value set.

Reviewers should note:

  • No change to runtime behavior for existing models — this is a type correctness fix that also makes xhigh explicitly safe end-to-end.
  • The request builder (openai-native.ts) and persistence layer (provider-settings.ts) already handled xhigh correctly via ReasoningEffortExtended; only the UI component's types were wrong.

Test Procedure

  • Unit tests updated in ThinkingBudget.spec.tsx:
    • Select/SelectContent/SelectItem mocks now thread onValueChange through so selection behavior can be exercised.
    • New test asserts xhigh renders for a GPT-5.5-shaped capability array, with no stray disable/max entries.
    • New test clicks select-item-xhigh and asserts setApiConfigurationField("enableReasoningEffort", true) and setApiConfigurationField("reasoningEffort", "xhigh") are both called.
  • pnpm --filter @roo-code/vscode-webview check-types — clean
  • pnpm --filter @roo-code/types test — 225/225 pass
  • 23/23 ThinkingBudget.spec.tsx tests pass

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Get in Touch

edelauna@gmail.com

Summary by CodeRabbit

  • New Features

    • Expanded the “reasoning effort” dropdown for supported models to include higher tiers (for example, xhigh and max).
    • Improved the dropdown’s option handling and fallback behavior when the saved/default value isn’t available for the current model (including proper disable availability).
  • Tests

    • Added coverage for fallback scenarios and for selecting/persisting higher tiers like xhigh, including correct behavior with empty supportsReasoningEffort.

@edelauna edelauna changed the title fix(ThinkingBudget): handling xhigh, max and disabled values fix(ThinkingBudget): support xhigh and all extended reasoning effort values (#713) Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: da6b5a3b-8aec-4134-b720-755a78a8df65

📥 Commits

Reviewing files that changed from the base of the PR and between 41ba0c3 and ba9c46d.

📒 Files selected for processing (1)
  • webview-ui/src/components/settings/__tests__/ThinkingBudget.spec.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • webview-ui/src/components/settings/tests/ThinkingBudget.spec.tsx

📝 Walkthrough

Walkthrough

ThinkingBudget.tsx now uses extended reasoning-effort typing and option handling to support higher tiers such as xhigh and max. The tests and select mocks were updated to cover fallback behavior, option rendering, and persistence for xhigh.

Changes

Reasoning Effort Tier Expansion

Layer / File(s) Summary
Extended reasoning effort option derivation
webview-ui/src/components/settings/ThinkingBudget.tsx
Type imports and inline documentation switch to ReasoningEffortExtended; option derivation, defaulting, and selection persistence now use the extended effort set and keep "disable" handling based on the model capability shape.
Tests and mocks for xhigh tier
webview-ui/src/components/settings/__tests__/ThinkingBudget.spec.tsx
Adds React import, updates Select/SelectItem mocks to propagate selection changes, and adds tests for fallback selection, xhigh rendering, and xhigh persistence.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • taltas

Poem

A rabbit peeks at dropdown skies,
With xhigh and max in shiny guise.
It hops through tests with careful cheer,
And saves the reasoning choices clear. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the ThinkingBudget reasoning-effort update and extended option support.
Description check ✅ Passed The description matches the template with issue link, implementation summary, testing steps, checklist, and reviewer notes.
Linked Issues check ✅ Passed The PR adds extended reasoning-effort support, including max, which matches the linked issue's request.
Out of Scope Changes check ✅ Passed The code and tests stay focused on the reasoning-effort dropdown types, options, and selection behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue/713

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.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...view-ui/src/components/settings/ThinkingBudget.tsx 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@edelauna edelauna marked this pull request as ready for review June 30, 2026 22:21

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
webview-ui/src/components/settings/ThinkingBudget.tsx (1)

92-110: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the select value inside the explicit option set. For array-based supportsReasoningEffort values that omit "disable", currentReasoningEffort still resolves to "disable" on first render, but Radix Select leaves the trigger empty when the controlled value has no matching SelectItem. Derive the fallback from availableOptions instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview-ui/src/components/settings/ThinkingBudget.tsx` around lines 92 - 110,
The controlled select value can fall outside the rendered option set when an
explicit supportsReasoningEffort array omits "disable", causing the Radix Select
trigger to render empty. Update ThinkingBudget’s option/value logic so
currentReasoningEffort is derived from availableOptions (for example, fall back
to the first valid item or another item in the explicit set) instead of
hardcoding "disable", and keep the selected value guaranteed to match one of the
rendered ReasoningEffortOption items.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@webview-ui/src/components/settings/ThinkingBudget.tsx`:
- Around line 92-110: The controlled select value can fall outside the rendered
option set when an explicit supportsReasoningEffort array omits "disable",
causing the Radix Select trigger to render empty. Update ThinkingBudget’s
option/value logic so currentReasoningEffort is derived from availableOptions
(for example, fall back to the first valid item or another item in the explicit
set) instead of hardcoding "disable", and keep the selected value guaranteed to
match one of the rendered ReasoningEffortOption items.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: be695fd6-744b-4e1f-abcc-c1f3e20013a1

📥 Commits

Reviewing files that changed from the base of the PR and between 67df9f9 and 5299fea.

📒 Files selected for processing (2)
  • webview-ui/src/components/settings/ThinkingBudget.tsx
  • webview-ui/src/components/settings/__tests__/ThinkingBudget.spec.tsx

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Jun 30, 2026
@github-actions github-actions Bot removed the awaiting-review PR changes are ready and waiting for maintainer re-review label Jul 1, 2026
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Jul 1, 2026
@edelauna edelauna added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 211d360 Jul 1, 2026
12 checks passed
@edelauna edelauna deleted the issue/713 branch July 1, 2026 03:00
hacker-b2k pushed a commit to hacker-b2k/Zoo-Code that referenced this pull request Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] 💡 Add MAX to the Model Reasoning Effort dropdown in the model settings

2 participants