Skip to content

ssh agent host: accept localhost in startup banner regex#314640

Merged
roblourens merged 1 commit into
mainfrom
roblou/agents/ssh-agent-host-command-update
May 6, 2026
Merged

ssh agent host: accept localhost in startup banner regex#314640
roblourens merged 1 commit into
mainfrom
roblou/agents/ssh-agent-host-command-update

Conversation

@roblourens
Copy link
Copy Markdown
Member

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-host command to the new agent host subcommand, the startup banner format changed. The CLI now prints its WebSocket URL via print_network_lines in cli/src/commands/output.rs as:

  ➜  Local:    ws://localhost:49415?tkn=<token>

…but startRemoteAgentHost in sshRemoteAgentHostService.ts was matching /ws:\/\/127\.0\.0\.1:(\d+)(?:\?tkn=([^\s&]+))?/, which never matched localhost. 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.1 or localhost.

(Written by Copilot)

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>
Copilot AI review requested due to automatic review settings May 6, 2026 04:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Screenshot Changes

Base: 89fc6394 Current: 529fae3e

Changed (11)

chat/input/chatInput/Default/Dark
Before After
before after
chat/input/chatInput/WithArtifacts/Dark
Before After
before after
chat/input/chatInput/WithTodos/Light
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Light
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Light
Before After
before after
chat/input/chatInput/Full/Dark
Before After
before after
chat/input/chatInput/Full/Light
Before After
before after
chat/widget/chatWidget/SimpleQA/Dark
Before After
before after
chat/widget/chatWidget/SimpleQA/Light
Before After
before after
chat/widget/chatWidget/MultiTurn/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 as ws://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

Comment thread src/vs/platform/agentHost/node/sshRemoteAgentHostService.ts
@roblourens roblourens marked this pull request as ready for review May 6, 2026 04:36
@roblourens roblourens enabled auto-merge (squash) May 6, 2026 04:36
@roblourens roblourens merged commit ffb8623 into main May 6, 2026
58 of 60 checks passed
@roblourens roblourens deleted the roblou/agents/ssh-agent-host-command-update branch May 6, 2026 16:00
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants