microsoft / microsoft/vscode-remote-release
Background agent worktrees do not work in Dev Containers
Open
@chrmarti is already working on this.
Since Feb 5, 2026.
containers
feature-request
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
Does this issue occur when all extensions are disabled?: N/A
- VS Code Version: 1.109.0
- OS Version: Windows 11 (WSL2)
Attempting to use worktrees with Background agents doesn't work inside Dev Containers, due to permissions:
2026-02-05 14:56:41.915 [error] [ChatSessionWorktreeService][_createWorktree] Error creating worktree for isolation:: Failed to execute git {
"exitCode": 128,
"gitCommand": "worktree",
"stdout": "",
"stderr": "Preparing worktree (new branch 'copilot-worktree-2026-02-05T14-56-41')\nfatal: could not create leading directories of '/workspaces/my-repo.worktrees/copilot-worktree-2026-02-05T14-56-41/.git': Permission denied\n"
}
Steps to Reproduce:
- Open a repository in a Dev Container
- Attempt to use background agent from GitHub Copilot Chat
Interestingly, this error does not occur when using GitHub Codespaces, as the permissions in /workspaces are different.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.