Skip to content

Allow Mermaid diagrams in Plan mode#4979

Open
OrenMe wants to merge 4 commits intomicrosoft:mainfrom
OrenMe:orenm/plan-mermaid
Open

Allow Mermaid diagrams in Plan mode#4979
OrenMe wants to merge 4 commits intomicrosoft:mainfrom
OrenMe:orenm/plan-mermaid

Conversation

@OrenMe
Copy link
Copy Markdown

@OrenMe OrenMe commented Apr 4, 2026

This PR enables Mermaid diagrams in Plan mode behind an explicit configuration gate and updates the Plan prompt so Mermaid diagrams are rendered consistently when they materially help a plan.

Key changes:

  • Add a Plan-specific Mermaid setting and expose it in the settings UI
  • Gate the Mermaid render tool and Plan prompt instructions behind that setting
  • Restore the Plan style-guide wrapper and keep Mermaid instructions concise and explicit
  • Add regression coverage for the Plan agent generated content
  • Update the switch-to-Plan path so it reflects the same Plan-mode Mermaid guidance

Refs microsoft/vscode#307804.

Copilot AI review requested due to automatic review settings April 4, 2026 10:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables the Plan agent to include Mermaid diagrams (and use the Mermaid render tool) when explicitly enabled via configuration, keeping Plan-mode output rules consistent across agent generation and the switch-to-Plan tool.

Changes:

  • Add chat.planAgent.mermaid.enabled / github.copilot.chat.planAgent.mermaid.enabled configuration and localized description.
  • Gate Plan agent body instructions + tool list to include Mermaid guidance and the Mermaid render tool only when enabled.
  • Add/extend PlanAgentProvider regression tests around Mermaid gating and style-guide rules.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/platform/configuration/common/configurationService.ts Adds a Plan-specific Mermaid enablement config key.
src/extension/tools/vscode-node/switchAgentTool.ts Switch-to-Plan message now reflects Mermaid guidance based on the setting.
src/extension/agents/vscode-node/planAgentProvider.ts Conditionally injects Mermaid rules + tool, and updates Plan style guide wrapper/rules.
src/extension/agents/vscode-node/test/planAgentProvider.spec.ts Adds regression coverage for Mermaid gating + Plan output rules.
package.nls.json Adds localized setting description.
package.json Exposes the new setting and also changes build scripts to use tsx.

OrenMe added 3 commits April 4, 2026 14:05
Replace duplicated conditional string construction for rulesSection with baseRules and mermaidRules arrays, merge them conditionally based on planAgentMermaidEnabled, and join with newlines. This simplifies the logic, improves readability and makes it easier to extend or modify rule lines while preserving the original Mermaid-enabled behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants