Expensive fetch in Copilot code search for repo tracking
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
- Copilot Chat Extension Version: Not sure
- VS Code Version: 1.125.1
- OS Version: MacOS Tahoe
- Feature (e.g. agent/edit/ask mode): NA
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): NA
- Logs:
Hi team,
We've noticed that the Copilot plugin is spuriously performing fetches - which can be very expensive when dealing with a large repo.
It boils down to the repo tracker component in code search. From the comments, it's supposed to check the SSH config if no remotes were found - but it seems to perform a fetch with dry-run flag and parses the verbose ssh output.
https://github.com/microsoft/vscode/blob/main/extensions/copilot/src/platform/workspaceChunkSearch/node/codeSearch/repoTracker.ts#L386
However, a fetch dry-run still performs all the network operations and the only "dry-run" part is that it doesn't write the refs in the end. This seems to be unnecessarily expensive, and I'm curious if we can consider a cheaper alternative (ls-remote?) or avoid the network operations entirely?
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.