Summary
When a Copilot session creates a worktree from an existing project checkout, the worktree appears to be initialized from the Git branch without carrying over the source checkout's untracked files. In my GoModel checkout, local launcher scripts and other untracked project files were present in the source directory but missing from the new session worktree. The session therefore started without the files needed to reproduce and fix the reported issue.
The agent's later attempt to compensate with rsync was unsafe and caused additional damage; that was a separate mistake, not the original bug. The underlying issue is that worktree creation did not preserve or clearly account for the user's untracked source files.
Expected behavior
When creating a worktree session from an existing checkout, Copilot should make the source working-tree context available, including untracked files, or clearly identify what will not be copied and provide a safe, non-destructive way to bring those files into the session. Sensitive local files such as credentials should be excluded or handled with explicit user control.
Actual behavior
The worktree was created from the tracked branch state only. Untracked files already in the source project were absent, so the session initially could not find the user's launcher script or related project files.
Reproduction
- In a project checkout, create one or more untracked project files.
- Start a new Copilot session using a worktree for that project.
- Check whether the new worktree contains those untracked files.
- Observe that the worktree lacks the source files even though they existed before session creation.
Suggested fix
Make worktree initialization aware of the source checkout's untracked working-tree files. Copy eligible files into the new worktree without overwriting existing data, and provide explicit safeguards or opt-outs for secrets, local environment files, caches, and other user-specific data. At minimum, report which files were omitted and offer a safe transfer path.
Summary
When a Copilot session creates a worktree from an existing project checkout, the worktree appears to be initialized from the Git branch without carrying over the source checkout's untracked files. In my GoModel checkout, local launcher scripts and other untracked project files were present in the source directory but missing from the new session worktree. The session therefore started without the files needed to reproduce and fix the reported issue.
The agent's later attempt to compensate with
rsyncwas unsafe and caused additional damage; that was a separate mistake, not the original bug. The underlying issue is that worktree creation did not preserve or clearly account for the user's untracked source files.Expected behavior
When creating a worktree session from an existing checkout, Copilot should make the source working-tree context available, including untracked files, or clearly identify what will not be copied and provide a safe, non-destructive way to bring those files into the session. Sensitive local files such as credentials should be excluded or handled with explicit user control.
Actual behavior
The worktree was created from the tracked branch state only. Untracked files already in the source project were absent, so the session initially could not find the user's launcher script or related project files.
Reproduction
Suggested fix
Make worktree initialization aware of the source checkout's untracked working-tree files. Copy eligible files into the new worktree without overwriting existing data, and provide explicit safeguards or opt-outs for secrets, local environment files, caches, and other user-specific data. At minimum, report which files were omitted and offer a safe transfer path.