feat: add Plan Mode support for Copilot CLI background agents#3881
Merged
DonJayamanne merged 9 commits intomainfrom Feb 20, 2026
Merged
feat: add Plan Mode support for Copilot CLI background agents#3881DonJayamanne merged 9 commits intomainfrom
DonJayamanne merged 9 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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 newChatCustomAgentProviderthat registers a "Plan" custom agent by dynamically generating a.agent.mdfile in extension global storage - Updates session handling to detect plan mode from
request.modeInstructions2and set the SDK session'scurrentModeproperty 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`;
src/extension/agents/copilotcli/node/copilotcliSessionService.ts
Outdated
Show resolved
Hide resolved
Contributor
|
@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. |
dmitrivMS
approved these changes
Feb 20, 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.
Summary
Adds Plan Mode support for Copilot CLI background agents.
Changes
github.copilot.chat.cli.planMode.enabled(default:false, taggedadvanced/experimental) to gate Plan Mode activation.PlanAgentProvider: A newChatCustomAgentProviderthat registers a "Plan" custom agent by writing a.agent.mdfile to extension global storage. The agent is identified via a sentinel string in its content.request.modeInstructions2and setscurrentMode = 'plan'on the SDK session accordingly.PlanAgentProviderregistration is now correctly gated onCLIPlanModeEnabled(notCLICustomAgentsEnabled).