Gate tip.planMode on the openPlan command being registered - #328262
Open
meganrogge with Copilot wants to merge 3 commits into
Open
Gate tip.planMode on the openPlan command being registered#328262meganrogge with Copilot wants to merge 3 commits into
meganrogge with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix unhandled error for chat open plan command
Gate tip.planMode on the openPlan command being registered
Jul 30, 2026
meganrogge
approved these changes
Jul 30, 2026
meganrogge
marked this pull request as ready for review
July 30, 2026 21:09
meganrogge
enabled auto-merge (squash)
July 30, 2026 21:09
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents the Plan mode tip from linking to an unavailable command.
Changes:
- Adds required-command metadata to chat tips.
- Filters tips using command registration.
- Tests Plan tip exclusion when its command is unavailable.
Show a summary per file
| File | Description |
|---|---|
chatTipCatalog.ts |
Marks the Plan tip as requiring openPlan. |
chatTipService.ts |
Checks required commands during eligibility. |
chatTipService.test.ts |
Covers registered and unavailable Plan commands. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Medium
Comment on lines
+763
to
+765
| if (tip.requiresCommands?.some(commandId => !CommandsRegistry.getCommand(commandId))) { | ||
| this._logService.debug('#ChatTips: tip is not eligible because a required command is not registered', tip.id, tip.requiresCommands); | ||
| return false; |
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
meganrogge
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Clicking the "Plan agent" link in the
tip.planModechat tip threwcommand 'workbench.action.chat.openPlan' not found.workbench.action.chat.openPlanis not a built-in command — "Plan" is a custom chat mode, and its open-command is registered dynamically byModeActionsContributiononly when a Plan mode is present in the focused widget. The tip'swhenclause (chatModeName != 'Plan') is true for everyone not currently in Plan mode, including users with no Plan mode at all, so the tip and its dead command link were shown even though the command was never registered.Changes
chatTipCatalog.ts— Added optionalrequiresCommands?: readonly string[]toITipDefinition; setrequiresCommands: ['workbench.action.chat.openPlan']ontip.planMode.chatTipService.ts—_isEligiblenow skips a tip when any of itsrequiresCommandsis absent fromCommandsRegistry.chatTipService.test.ts— RegisteropenPlaninsetup()(mirrors "Plan mode available"); added a test assertingtip.planModeis never shown when the command is unregistered.This is reusable: any tip linking to an optionally-available command can guard itself the same way to avoid "command not found" errors.