Copilot Chat stalls after listDirectory/textSearch in Remote-SSH workspace on VS Code 1.136.1
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Type of issue
Regression / Performance / Copilot Chat agent tools / Remote-SSH
## Description
Copilot Chat stalls indefinitely at “Loading” or “Connecting” in a large
Remote-SSH workspace when the built-in `listDirectory` or `textSearch` tools
are enabled.
Remote-SSH itself remains healthy: files can be browsed, terminals work, and
commands execute normally. Disabling only these two tools restores normal
Copilot Chat responsiveness.
Downgrading VS Code from 1.136.1 to 1.135.0 also avoids the problem in the
same remote workspace.
## Environment
Local OS: macOS
Remote OS: Ubuntu 22.04.2 LTS, Linux 5.15, x86_64
Remote connection: VS Code Remote-SSH
Affected VS Code:
- Version: 1.136.1
- Commit: a44adf7f53e00964ab890f9f8758a334f1fc15bc
- Bundled GitHub Copilot Chat: 0.64.1
Working comparison:
- VS Code: 1.135.0
- Bundled GitHub Copilot Chat: 0.63.0
The remote workspace is a large source/build sandbox containing generated
object, log, package, and source-tree directories.
## Steps to reproduce
1. Connect to a large Linux workspace using Remote-SSH.
2. Open Copilot Chat in Agent mode.
3. Ensure the built-in Search tools are enabled, particularly:
- `listDirectory`
- `textSearch`
4. Ask Copilot to investigate or modify code, causing it to search or enumerate
the workspace.
5. Observe that the relevant tool may start or appear to complete, but Copilot
remains at “Loading” and does not continue the turn.
A more targeted reproduction is to ask Copilot to use `listDirectory` on a
large directory or `textSearch` across the workspace.
## Actual result
Copilot stops progressing after a workspace file tool call. The chat remains
at “Loading” or “Connecting” without a useful error.
In some cases the tool card appears complete, but no subsequent model request
or response occurs.
The editor, Remote-SSH connection, file browsing, and terminal continue to
work.
## Expected result
The tool result should be bounded and returned to the agent, after which
Copilot should continue the turn or report an explicit timeout/error.
## A/B results
| Configuration | Result |
|---|---|
| VS Code 1.136.1, all Search tools enabled | Stalls |
| VS Code 1.136.1, `listDirectory` disabled | Improved |
| VS Code 1.136.1, `textSearch` disabled | Improved |
| VS Code 1.136.1, both disabled | Copilot responds normally |
| VS Code 1.135.0, same workspace | Works |
| Same remote host using Explorer/terminal | Works |
Other Search tools such as `fileSearch`, `codebase`, and `usages` do not appear
to trigger the problem.
## Troubleshooting already performed
The following were ruled out:
- SSH connectivity failure
- Remote filesystem access failure
- GitHub/Copilot authentication failure
- DNS, TLS, proxy, or certificate failure
- Copilot service outage
- Remote CPU or memory exhaustion
- Disk space or inode exhaustion
Copilot and GitHub endpoint checks returned HTTP 200 from the remote host.
The remote host has ample capacity:
- 96 CPUs
- Approximately 754 GiB RAM
- Approximately 704 GiB available
- Filesystem approximately 50% used
- Inodes approximately 23% used
## Workaround
Disable `listDirectory` and `textSearch` in Copilot’s tool picker and start a
new chat.
A contaminated existing chat may remain slow after disabling the tools,
especially if a very large directory result was already inserted into its
history.
Downgrading to VS Code 1.135.0 is another temporary workaround.
## Additional observations
The `listDirectory` implementation appears to return every directory entry
without pagination, a result limit, exclusion handling, or timeout.
The `textSearch` implementation has result limits and a timeout, but the agent
can still stall after the tool appears to complete.
A minimal prompt (`you there?`) reproduced the stall without invoking any
workspace tool.
The UserPromptSubmit hook completed successfully at 23:00:24.804. The agent
loop started at 23:00:24.808, and automatic instruction collection completed
at 23:00:25.861. No model request, tool invocation, request completion, or
explicit error followed.
This suggests the enabled search tools trigger the problem during request
preparation/tool registration rather than during filesystem search execution.
The remote extension host also emitted a PendingMigrationError from the bundled
Copilot extension during activation:
PendingMigrationError: navigator is now a global in nodejs
.../server/extensions/copilot/dist/extension.js
Copilot subsequently completed activation, so it is unclear whether this error
is causal.
[vscode_output.log](https://github.com/user-attachments/files/31868357/vscode_output.log)
## Related issues
- #324907: `list_dir` returns unbounded output and can freeze/poison chat
- #332431: agent tool loop silently stalls after file/search tool results
Contributor guide
Assessment
This issue has not been assessed yet.