When a new Agent Host session uses worktree isolation, its prompt-derived worktree directory can already exist even when the corresponding Git branch does not. In that case, git worktree add fails with an error like:
fatal: '/Users/tyleonha/Code/Microsoft/vscode.worktrees/greeting-response' already exists
Worktree naming should treat both existing branches and existing target paths as collisions, choose another available name, and avoid races between concurrent session creation in the same repository.
(Written by Copilot)
When a new Agent Host session uses worktree isolation, its prompt-derived worktree directory can already exist even when the corresponding Git branch does not. In that case,
git worktree addfails with an error like:Worktree naming should treat both existing branches and existing target paths as collisions, choose another available name, and avoid races between concurrent session creation in the same repository.
(Written by Copilot)