sessions: show pending automatic host connections on web - #336487
Aaron Munger (amunger) wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
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
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.
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]>
654b610 to
0b90bbf
Compare
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]>
Screenshot ChangesBase: Changed (2)4 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details. |
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|


Summary
Keep web
/agentshosts 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
Product validation
Used standalone Chromium against the local
/agentsbuild 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.