Copilot keeps asking to edit an external file when it's trying to edit the README.md in a network drive workspace
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
- Copilot Chat Extension Version: **Not shown in VS Code. Just says built-in**
- VS Code Version: 1.135.0 (user setup)
- OS Version: Windows 11 Pro 26H2 26300.9278
- Feature (e.g. agent/edit/ask mode): Agent Mode
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): GPT 5.6 Sol
- Logs: -
Steps to Reproduce:
1. Have a samba network drive mapped to `W:/`
2. Open folder/workspace pointing to `W:/Workspace`
3. Add README.md file in `W:/Workspace`
4. Ask Copilot to edit README.md file in `W:/Workspace/README.md`
5. 95% of the time it will ask for external file approval
5% of the time it manages to edit the README.md and 95% of the time it asks me to edit an external file. So obviously it's technically possible, but the agent gets confused.
From my feeling it looks like `read_file` produces that error more consistently while `apply_patch` works more often without erroneously requesting external access. Might also have something to do with changing `W:/` and `w:/` upper and lower case or something to do with resolution of `W:/Workspace` to and UNC path resulting in a mismatch.
Excerpt from me letting Copilot test the tools:
> With read_file(filePath: "README.md", startLine: 1, endLine: 3), the tool returned Invalid input path: README.md because it requires an absolute path. With apply_patch targeting README.md, it returned File not found: README.md. Using the absolute workspace path, read_file(filePath: "W:\\Media\\Books\\README.md", startLine: 1, endLine: 3) incorrectly triggered an external-file approval prompt and returned The user chose to skip the tool call. In contrast, apply_patch with *** Update File: W:/Media/Books/README.md accessed and edited the same file without approval, returning The following files were successfully edited: w:\Media\Books\README.md. The test change was reverted and diagnostics reported no errors.
Contributor guide
Assessment
This issue has not been assessed yet.