ssh agent host: accept localhost in startup banner regex#314640
Merged
Conversation
The CLI's `agent host` subcommand prints its listening URL via print_network_lines as `ws://localhost:<port>?tkn=...`, but the SSH remote agent host startup parser was only matching `ws://127.0.0.1:`. This caused remote agent host startup to time out after 60s. Broaden the host portion of the regex to accept either `127.0.0.1` or `localhost`. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Screenshot ChangesBase: Changed (11) |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes SSH remote agent host startup timing out by updating the banner parsing in startRemoteAgentHost to recognize the new CLI output format that advertises the WebSocket URL with localhost (in addition to 127.0.0.1).
Changes:
- Broadened the WebSocket listening-banner regex to accept
ws://localhost:<port>as well asws://127.0.0.1:<port>. - Preserved existing port/token extraction behavior while unblocking readiness detection.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/node/sshRemoteAgentHostService.ts | Updates the startup output parsing regex so SSH startup can resolve when the CLI prints ws://localhost:PORT?.... |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
osortega
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SSH remote agent host startup was timing out after 60s because we couldn't parse the CLI's listening banner.
When we switched from the legacy
agent-hostcommand to the newagent hostsubcommand, the startup banner format changed. The CLI now prints its WebSocket URL viaprint_network_linesincli/src/commands/output.rsas:…but
startRemoteAgentHostinsshRemoteAgentHostService.tswas matching/ws:\/\/127\.0\.0\.1:(\d+)(?:\?tkn=([^\s&]+))?/, which never matchedlocalhost. Result: the startup promise never resolved and the SSH agent host failed to come up.Fix: broaden the host portion of the regex to accept either
127.0.0.1orlocalhost.(Written by Copilot)