Skip to content

fix(web): only surface opencode plan agent with legacy plan mode on - #6420

Open
UtkarshUsername wants to merge 9 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/opencode-hide-plan-agent
Open

fix(web): only surface opencode plan agent with legacy plan mode on#6420
UtkarshUsername wants to merge 9 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/opencode-hide-plan-agent

Conversation

@UtkarshUsername

@UtkarshUsername UtkarshUsername commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What Changed

The opencode plan agent now only appears in T3's Agent dropdown while legacy plan mode is enabled. With plan mode feature off, the option is removed from the model's capabilities in getProviderModelCapabilities, so it can't be selected or dispatched. When plan mode feature is on, it shows as before. Threaded through the composer, model settings, and project settings (all share TraitsPicker), and covered by a test that a stale agent: plan selection self-heals to build.

Why

T3's plan mode is now a legacy feature and defaults to off, but the opencode plan agent still showed up in the dropdown regardless. Gating the option on the same planModeEnabled client setting keeps the two in sync.

Screenshots

Before:
Plan mode is an option even when it is disabled in settings
image

After:
Plan mode is not an option when disabled in settings
image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes

Note

Hide plan agent options in chat composer and settings when legacy plan mode is off

  • Adds planModeEnabled as a parameter through getProviderModelCapabilities, getComposerProviderState, TraitsPicker, and TraitsMenuContent so the plan agent option is excluded from capabilities, selections, and UI controls when plan mode is disabled.
  • Introduces withoutPlanAgentSelection in modelSelection.ts to sanitize persisted model selections, and calls it when the user disables legacy plan mode to remove any stored plan agent choice.
  • Behavioral Change: disabling legacy plan mode now retroactively strips the agent: plan option from saved textGenerationModelSelection and sourceControlWriterModelSelection settings.

Macroscope summarized 5ce1d4b.


Note

Low Risk
Client-side gating of a legacy model option and settings cleanup; no auth or data-path changes, with unit tests for dispatch and selection sanitization.

Overview
Hides the opencode “plan” agent unless legacy plan mode is enabled, so the Agent dropdown and dispatched model options stay aligned with Settings → Beta → Plan mode (legacy).

getProviderModelCapabilities now strips the agent: plan option (and drops the agent descriptor when plan was the only choice) when planModeEnabled is false. That flag is threaded through the composer traits UI, getComposerProviderState, and settings/project model pickers. Composer dispatch falls back to build instead of sending a stale plan selection, and turning plan mode off also scrubs agent: plan from stored text-generation and source-control writer selections via withoutPlanAgentSelection.

Reviewed by Cursor Bugbot for commit 5ce1d4b. Bugbot is set up for automated code reviews on this repo. Configure here.

@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: 1427e696-d4de-4c1e-8d0e-406c3b856780

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 size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 13, 2026
Comment thread apps/web/src/providerModels.ts Outdated
@UtkarshUsername
UtkarshUsername marked this pull request as ready for review August 13, 2026 03:25

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

Reviewed by Cursor Bugbot for commit 147f7d9. Configure here.

Comment thread apps/web/src/modelSelection.ts
@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR gates agent visibility based on a legacy setting, propagating planModeEnabled through multiple components to filter out the plan agent when disabled. Changes that control feature availability and stored user selections warrant human review to verify the intended behavior.

You can customize Macroscope's approvability policy. Learn more.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Aug 13, 2026
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:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant