Skip to content

Background agent worktrees do not work in Dev Containers #293139

@cecheta

Description

@cecheta

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.

Apologies if this issue is created in the wrong repo.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions