Skip to content

sessions: show pending automatic host connections on web - #336487

Open
Aaron Munger (amunger) wants to merge 4 commits into
mainfrom
sessions/web-pending-connection-status
Open

Aaron Munger (amunger) wants to merge 4 commits into
mainfrom
sessions/web-pending-connection-status

Conversation

@amunger

@amunger Aaron Munger (amunger) commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Keep web /agents hosts visibly Connecting while automatic connection setup is still in progress, even after discovery finishes and before a protocol connection entry exists.

Previously, discovery could finish and the indicator turn idle while transport setup continued. The passive indicator and modal host summary now reflect actual pending setup, and captured diagnostics include the attempt's start time, elapsed time, automatic/manual trigger, and whether a protocol connection entry exists.

On phones, Connection Information is also accessible beside the Hosts sheet title. Opening it dismisses the picker first; closing the report restores the originating control, or its workbench toolbar if the control was replaced while the host connected.

Implementation and boundaries

  • Expose actual in-flight attempts through a read-only catalog and dedicated invalidation event, rather than inferring activity from discovery or historical log events.
  • Preserve established, reconnecting, and incompatible states. Completed attempts clear by identity; removed, disabled, and disposed hosts are excluded from the catalog.
  • Preserve connection scheduling, retry policy, and native UI status behavior. The connection indicator remains passive.
  • Rebased onto main including sessions: Add connection-stage diagnostic evidence #336443. Pending state now coexists with its asynchronous snapshot capture, connection-stage history, and Window-log excerpt. Tests verify that a historical start event does not keep a completed attempt marked pending.
  • Tighten notification regression tests, use one numeric snapshot timestamp for elapsed calculations, and document the pending-state contract.

Product validation

Used standalone Chromium against the local /agents build with deliberately delayed mock transport setup. Desktop and phone-emulated runs verified pending status in the indicator and modal, combined pending/stage/log evidence, Copy/Download equivalence allowing Windows clipboard line endings, and transition to Connected. The phone Hosts-sheet information entry was activated using actual Playwright touch taps.

This uncovered a focus loss when the mobile toolbar replaced the original host control while diagnostics was open. The toolbar fallback now passes both the targeted regression test and the completed desktop/phone-emulated end-to-end rerun, including replacement of the original mobile control. Device emulation is not physical-phone/PWA or real-tunnel validation.

Additional manual-connection validation caught a staging race: clearing suppression before staging could start an automatic dial first. Suppression now clears as part of staging, and the pending catalog reads the factory’s effective initiation mode. Held both automatic and manual attempts pending in Chromium and verified their respective triggers in downloaded diagnostics, equivalent copied evidence, eventual Connected state, and phone touch/focus recovery.

Copilot AI balanced review requested due to automatic review settings September 16, 2026 21:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Manual tunnel attempts can be mislabeled as automatic, and the pending-event test does not isolate the new event path.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced (auto)
Findings: 1 Medium severity · 1 Low severity

Note

Copilot is running an experiment and ran this review at Balanced.

Open (2)
What changed in this PR

Keeps web Agent Host connections visibly pending during setup and adds pending-attempt diagnostics.

Changes:

  • Exposes pending connection attempts and change events.
  • Integrates pending state into web status and diagnostics.
  • Adds lifecycle and UI-status tests.
File Description
remoteAgentHostService.ts Defines the pending-connection API.
remoteAgentHostServiceImpl.ts Tracks pending attempt lifecycle.
remoteAgentHostService.test.ts Tests pending cleanup outcomes.
tunnelAgentHost.contribution.ts Displays pending tunnels as connecting.
connectionDiagnosticsService.ts Reports pending attempt metadata.
tunnelAgentHost.contribution.test.ts Tests pre-protocol connecting status.
connectionDiagnosticsService.test.ts Tests diagnostics and platform behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.ts Outdated
Expose in-flight setup before a protocol connection entry exists so discovery completion does not make web hosts appear disconnected. Include pending attempt timing and initiation in diagnostic snapshots while preserving connection policy and native status behavior.

Co-authored-by: Copilot <[email protected]>
Preserve the additional mobile host-sheet information entry point and its focus restoration and touch coverage.

Co-authored-by: Copilot <[email protected]>
Strengthen pending notifications and combined stage/log tests, clarify the catalog contract, and restore toolbar focus when mobile host controls are replaced during capture.

Co-authored-by: Copilot <[email protected]>
@amunger
Aaron Munger (amunger) force-pushed the sessions/web-pending-connection-status branch from 654b610 to 0b90bbf Compare September 16, 2026 23:06
Read factory-staged initiation before it is consumed, and defer suppression clearing to staging so a manual connect cannot race an automatic dial. Route titlebar focus through the mobile toolbar when returning from diagnostics.

Co-authored-by: Copilot <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: a2f67035 Current: c99c0a60

Changed (2)

sessions/connectionDiagnostics/connectionDiagnostics/EmptyHostPicker/Dark
Before After
before after
sessions/connectionDiagnostics/connectionDiagnostics/EmptyHostPicker/Light
Before After
before after

4 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

@amunger
Aaron Munger (amunger) marked this pull request as ready for review September 17, 2026 01:01
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Christopher Simmonds (@benibenj)

Matched files:

  • src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts
  • src/vs/sessions/browser/workbench.ts

@amunger
Aaron Munger (amunger) enabled auto-merge (squash) September 17, 2026 02:02
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.

2 participants