豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Copilot CLI: refactor how uncommitted changes are determined before creating a new CLI session#4756

Merged
lszomoru merged 4 commits intomainfrom
don/marine-ladybug
Mar 28, 2026
Merged

Copilot CLI: refactor how uncommitted changes are determined before creating a new CLI session#4756
lszomoru merged 4 commits intomainfrom
don/marine-ladybug

Conversation

@DonJayamanne
Copy link
Copy Markdown
Collaborator

No description provided.

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

Refactors the Copilot CLI “uncommitted changes” detection/prompting path that runs before creating a new CLI session/worktree, and adjusts related workspace-change tracking and tests.

Changes:

  • Update FolderRepositoryManager to determine uncommitted changes via gitService.getRepository(...) using the selected repository URI (and requested branch), and always use the vscode_get_modified_files_confirmation tool for the prompt.
  • Remove filesystem-watcher-based cache invalidation from ChatSessionWorkspaceFolderService and simplify constructor dependencies.
  • Update unit tests/fakes to align with the new repository lookup and revised service constructor.

Reviewed changes

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

Show a summary per file
File Description
src/extension/chatSessions/vscode-node/folderRepositoryManagerImpl.ts Refactors uncommitted-change prompting flow and repo lookup; removes old fallback confirmation path.
src/extension/chatSessions/vscode-node/chatSessionWorkspaceFolderServiceImpl.ts Removes workspace file watcher invalidation; relies on repo HEAD change to clear cached workspace changes.
src/extension/chatSessions/vscode-node/test/folderRepositoryManager.spec.ts Updates fake git service behavior to support new repo lookup during prompting.
src/extension/chatSessions/vscode-node/test/copilotCLIChatSessionParticipant.spec.ts Adjusts delegate-path setup to ensure repo is discoverable via getRepository.
src/extension/chatSessions/vscode-node/test/chatSessionWorkspaceFolderService.spec.ts Updates constructor usage and removes watcher-based cache invalidation tests.
Comments suppressed due to low confidence (1)

src/extension/chatSessions/vscode-node/folderRepositoryManagerImpl.ts:452

  • Skipping the uncommitted-changes confirmation when repository.headBranchName !== branch can suppress the prompt even when there are local changes, which means the user won't get a chance to copy/move them into the new worktree. Uncommitted changes (and the file list) can still be determined regardless of the target branch; if the concern is applying them onto a different branch, consider still prompting but adding a warning about potential conflicts, or compute the list against the correct ref instead of returning undefined here.
		if (branch && repository.headBranchName !== branch) {
			return undefined;

Comment thread src/extension/chatSessions/vscode-node/folderRepositoryManagerImpl.ts Outdated
Comment thread src/extension/chatSessions/vscode-node/chatSessionWorkspaceFolderServiceImpl.ts Outdated
DonJayamanne and others added 2 commits March 27, 2026 22:06
…Impl.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DonJayamanne DonJayamanne requested a review from lszomoru March 27, 2026 11:16
@DonJayamanne DonJayamanne marked this pull request as ready for review March 27, 2026 11:17
lszomoru
lszomoru previously approved these changes Mar 27, 2026
Comment thread src/extension/chatSessions/vscode-node/folderRepositoryManagerImpl.ts Outdated
@DonJayamanne DonJayamanne added this pull request to the merge queue Mar 28, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 28, 2026
@lszomoru lszomoru added this pull request to the merge queue Mar 28, 2026
Merged via the queue into main with commit 530b190 Mar 28, 2026
19 checks passed
@lszomoru lszomoru deleted the don/marine-ladybug branch March 28, 2026 20:12
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