microsoft / microsoft/vscode

Agent continues incorrectly on worktree creation failure

Open
#335,776 1 comment 0 reactions 1 assignee Claimed by @sandy081 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

testing #335077

Creating an isolated worktree for a chat fails on Windows when the working folder is nested deeply enough to hit the filename-length limit. The session then continues in the original folder.

### Steps to reproduce
1. Open a working folder in a deeply nested location on Windows so generated worktree paths can exceed the filename-length limit.
2. Start any chat that requires an isolated worktree.

- **Expected:** The isolated worktree is created successfully, including for deeply nested working folders.
- **Actual:** Worktree creation fails with Git exit code 128 and the session falls back to the original folder.
- **Environment:** Latest VS Code Insiders; Windows (exact version not provided).

![Isolated worktree creation failing with Git exit code 128](https://github.com/user-attachments/assets/b305fb59-1bdd-4b34-9795-c1ae77f318bd)

from output pane:

```text
fatal: Could not reset index file to revision 'HEAD'.
error: failed to open file 'src/vs/workbench/contrib/chat/test/common/requestParser/__snapshots__/ChatRequestParser_agent_host__forcedAgent___supportsPromptAttachments_revives__skill_as_prompt_slash_part.0.snap': Filename too long
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.