Skip to content

Gate tip.planMode on the openPlan command being registered - #328262

Open
meganrogge with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-unhandled-error-chat-command
Open

Gate tip.planMode on the openPlan command being registered#328262
meganrogge with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-unhandled-error-chat-command

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Clicking the "Plan agent" link in the tip.planMode chat tip threw command 'workbench.action.chat.openPlan' not found.

workbench.action.chat.openPlan is not a built-in command — "Plan" is a custom chat mode, and its open-command is registered dynamically by ModeActionsContribution only when a Plan mode is present in the focused widget. The tip's when clause (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 optional requiresCommands?: readonly string[] to ITipDefinition; set requiresCommands: ['workbench.action.chat.openPlan'] on tip.planMode.
  • chatTipService.ts_isEligible now skips a tip when any of its requiresCommands is absent from CommandsRegistry.
  • chatTipService.test.ts — Register openPlan in setup() (mirrors "Plan mode available"); added a test asserting tip.planMode is never shown when the command is unregistered.
if (tip.requiresCommands?.some(commandId => !CommandsRegistry.getCommand(commandId))) {
    return false;
}

This is reusable: any tip linking to an optionally-available command can guard itself the same way to avoid "command not found" errors.

Copilot AI requested review from Copilot and removed request for Copilot July 30, 2026 19:07
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 30, 2026 19:16
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
Copilot AI requested a review from meganrogge July 30, 2026 19:20
@meganrogge meganrogge added this to the 1.132.0 milestone Jul 30, 2026
@meganrogge
meganrogge marked this pull request as ready for review July 30, 2026 21:09
Copilot AI review requested due to automatic review settings July 30, 2026 21:09
@meganrogge
meganrogge enabled auto-merge (squash) July 30, 2026 21:09

Copilot AI 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.

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>
Copilot AI requested a review from meganrogge July 30, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Error] unhandlederror-command 'workbench.action.chat.openPlan' not found

3 participants