Skip to content

feat: add Plan Mode support for Copilot CLI background agents#3881

Merged
DonJayamanne merged 9 commits intomainfrom
don/copilot-worktree-2026-02-20T02-04-16
Feb 20, 2026
Merged

feat: add Plan Mode support for Copilot CLI background agents#3881
DonJayamanne merged 9 commits intomainfrom
don/copilot-worktree-2026-02-20T02-04-16

Conversation

@DonJayamanne
Copy link
Collaborator

Summary

Adds Plan Mode support for Copilot CLI background agents.

Changes

  • New setting: github.copilot.chat.cli.planMode.enabled (default: false, tagged advanced/experimental) to gate Plan Mode activation.
  • PlanAgentProvider: A new ChatCustomAgentProvider that registers a "Plan" custom agent by writing a .agent.md file to extension global storage. The agent is identified via a sentinel string in its content.
  • Session integration: Detects plan mode from request.modeInstructions2 and sets currentMode = 'plan' on the SDK session accordingly.
  • Config key fix: PlanAgentProvider registration is now correctly gated on CLIPlanModeEnabled (not CLICustomAgentsEnabled).

Copilot AI review requested due to automatic review settings February 20, 2026 02:07
@DonJayamanne DonJayamanne marked this pull request as draft February 20, 2026 02:07
Copy link
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

This PR adds Plan Mode support for Copilot CLI background agents, enabling users to leverage a planning-oriented interaction mode within CLI-based sessions. Plan Mode is a feature documented in GitHub's official changelog that allows developers to plan tasks before implementing them.

Changes:

  • Introduces a new experimental configuration setting github.copilot.chat.cli.planMode.enabled (default: false) to enable Plan Mode for background agents
  • Implements PlanAgentProvider, a new ChatCustomAgentProvider that registers a "Plan" custom agent by dynamically generating a .agent.md file in extension global storage
  • Updates session handling to detect plan mode from request.modeInstructions2 and set the SDK session's currentMode property accordingly

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/platform/configuration/common/configurationService.ts Adds new config key CLIPlanModeEnabled for the experimental plan mode setting
src/extension/chatSessions/vscode-node/copilotCLIPlanAgentProvider.ts New file implementing the Plan agent provider with sentinel-based mode detection
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts Detects plan mode from request and passes it to session handler
src/extension/chatSessions/vscode-node/chatSessions.ts Conditionally registers PlanAgentProvider when the feature flag is enabled
src/extension/agents/copilotcli/node/copilotcliSessionService.ts Refactoring: simplifies LocalSessionManager initialization by removing try-catch and type alias
src/extension/agents/copilotcli/node/copilotcliSession.ts Updates session to set currentMode to 'plan' or 'interactive' based on input
package.nls.json Adds localization string for the plan mode setting
package.json Adds the plan mode configuration setting with experimental tag
Comments suppressed due to low confidence (1)

src/extension/chatSessions/vscode-node/copilotCLIPlanAgentProvider.ts:14

  • The prompt text contains "Github Copilot CLI" but should use "GitHub" (with capital H) for consistency with GitHub branding. This should be corrected to "GitHub Copilot CLI".
const planPrompt = `Plan model is configured and defined within Github Copilot CLI`;

Copy link
Contributor

Copilot AI commented Feb 20, 2026

@DonJayamanne I've opened a new pull request, #3883, to work on those changes. Once the pull request is ready, I'll request review from you.

@DonJayamanne DonJayamanne marked this pull request as ready for review February 20, 2026 03:53
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 20, 2026
@DonJayamanne DonJayamanne added this pull request to the merge queue Feb 20, 2026
Merged via the queue into main with commit afa760a Feb 20, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the don/copilot-worktree-2026-02-20T02-04-16 branch February 20, 2026 04:54
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.

4 participants