-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Extension version
GitHub Copilot Chat 0.40.1
Environment
- VS Code remote / VS Code Server session on Linux
- Git
2.43.0
Problem
When I invoke Copilot CLI from Copilot Chat in workspace isolation mode (that is, no worktree is created), the extension stages all current repository changes after the request completes.
This results in previously unstaged tracked and untracked files becoming staged, even though I did not ask Copilot to prepare a commit.
Steps to reproduce
- Open any Git repository with unstaged changes.
- Start a Copilot Chat / Copilot CLI session in workspace isolation mode.
- Let the request complete.
- Check Git status.
Expected behavior
Copilot Chat / Copilot CLI should not stage repository changes in workspace mode unless the user explicitly requests a staging or commit action.
Actual behavior
All current changes are staged, equivalent to:
git add -A -- .Evidence
I could consistently correlate these behaviors:
GitHub Copilot Chat.logshowed:Workspace isolation mode selected ... skipping worktree creation
vscode.git/Git.logimmediately showed:> git add -A -- .
I also traced the relevant code paths in the installed extensions:
- Copilot Chat calls
ChatSessionWorkspaceFolderService.handleRequestCompleted(...) - that calls
this.gitService.add(folderUri, []) - Copilot Chat's
GitServiceImpl.add(...)forwards to the VS Code Git API - VS Code Git's
repository.add([])resolves togit add -A -- .
So it looks like add([]) in the workspace-mode completion path is effectively interpreted as stage everything.
Notes
This appears separate from the worktree / auto-commit flow. In my case the session was running in workspace mode, and I observed the staging behavior even without a subsequent git commit.
Please let me know if you'd like a more detailed repro or sanitized log excerpts.