Agent continues incorrectly on worktree creation failure
- 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).

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
Assessment
This issue has not been assessed yet.