microsoft / microsoft/vscode-remote-release

Background agent worktrees do not work in Dev Containers

Open
#11,588 4 comments 13 reactions 1 assignee View on GitHub

@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:

  1. Open a repository in a Dev Container
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.