Skip to content

feat: Implement Copillot CLI's Plan mode#4933

Draft
DonJayamanne wants to merge 8 commits intomainfrom
don/bumpy-impala
Draft

feat: Implement Copillot CLI's Plan mode#4933
DonJayamanne wants to merge 8 commits intomainfrom
don/bumpy-impala

Conversation

@DonJayamanne
Copy link
Copy Markdown
Collaborator

@DonJayamanne DonJayamanne commented Apr 2, 2026

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

Adds an opt-in setting to enable AI-generated branch names when Copilot CLI creates isolated worktrees, wiring the generator into the Copilot CLI session participants (both the “controller” and V1 implementations).

Changes:

  • Add new configuration key github.copilot.chat.cli.aiGenerateBranchNames.enabled (default: false) with localization.
  • Conditionally instantiate GitBranchNameGenerator based on the new setting and pass it into Copilot CLI session participants.
  • Thread an (optional) generated branch name into worktree initialization for new untitled CLI sessions; update unit tests for the new constructor parameter.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/platform/configuration/common/configurationService.ts Registers the new config key in ConfigKey.Advanced.
src/extension/chatSessions/vscode-node/chatSessions.ts Reads the new config and conditionally creates/passes GitBranchNameGenerator.
src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts Makes branch name generator optional and guards its usage.
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts Adds optional branch-name generation and passes it into folder/worktree initialization for V1 participant.
src/extension/chatSessions/vscode-node/test/copilotCLIChatSessionParticipant.spec.ts Updates participant construction to account for the new optional constructor parameter.
package.json Contributes the new setting to VS Code configuration.
package.nls.json Adds the localized description string for the new setting.
Comments suppressed due to low confidence (2)

src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts:1314

  • There are two statements on the same line (const branchNamePromise = ...; const [model, agent] = ...). This makes the control flow harder to read and is easy to miss during reviews/merges. Split these into separate lines/statements (and consider extracting isNewSession and branchNamePromise into clearly named variables).
			};
			const branchNamePromise = (isUntitled && request.prompt && this.branchNameGenerator) ? this.branchNameGenerator.generateBranchName(fakeContext, token) : Promise.resolve(undefined); const [model, agent] = await Promise.all([
				this.getModelId(request, token),
				this.getAgent(id, request, token),

src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts:1313

  • New behavior: when starting an untitled session, the participant may call branchNameGenerator.generateBranchName(...) and thread the result into initializeFolderRepository(... newBranch: ...). The existing unit tests for this participant never pass a GitBranchNameGenerator (they always pass undefined), so this feature path isn’t covered. Add a test that injects a stub generator and asserts it is invoked only for new sessions and that the resolved branch name is forwarded to worktree creation (via initializeFolderRepository/createWorktree).
			const requestTurn = new ChatRequestTurn2(request.prompt ?? '', request.command, [], '', [], [], undefined, undefined, undefined);
			const fakeContext: vscode.ChatContext = {
				history: [requestTurn],
				yieldRequested: false,
			};
			const branchNamePromise = (isUntitled && request.prompt && this.branchNameGenerator) ? this.branchNameGenerator.generateBranchName(fakeContext, token) : Promise.resolve(undefined); const [model, agent] = await Promise.all([
				this.getModelId(request, token),

@DonJayamanne DonJayamanne changed the title feat: add AI-generated branch names support in Copilot CLI feat: Implement Copillot CLI's Plan mode Apr 3, 2026
@DonJayamanne DonJayamanne marked this pull request as ready for review April 3, 2026 08:44
@DonJayamanne DonJayamanne marked this pull request as draft April 3, 2026 09:19
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.

2 participants