mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-30 06:58:55 +01:00
* Agent Host: surface remote connection state in sessions
A session backed by an unreachable remote host previously spun forever with
no explanation and no way to recover. Surface that state and make it
actionable:
- Derive a session-scoped `remoteConnectionStatus` from the provider so the
chat surface can react to connection state, not just host-scoped UI.
- Add machine-readable transport failure reasons so a stopped host is
distinguishable from an unreachable one.
- Show a centered recovery state with a Start action when a session has no
visible transcript, and a quiet inline banner when a rendered transcript
drops mid-use.
- Report live bootstrap progress ("Downloading server (24%)") while a
connect is in flight, via a shared progress parser.
- Split WSL startup, idle, and ceiling timeouts so a cold VM boot is not
mistaken for a hung connection.
- Gate terminal launches on host availability and re-resolve chat content
when a provider registers late.
Collect the connection concerns in ChatGroupView behind a single
SessionRemoteConnection, expressing state as observables with one derived
resolving which surface is visible. Read-only remains a peer of connection
state rather than part of it, since a read-only chat can also be
reconnecting. The quiet-reconnect delay is now a deadline, so re-arming is
idempotent instead of relying on a guard field.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agent Host: auto-start a stopped remote host from the recovery surface
Adds an opt-in, kind-scoped policy that starts a stopped remote agent host
instead of waiting for the user to press Start. Providers expose it through
`IAgentHostAutoConnect` (label, observable value, setter) and choose how it is
backed; WSL backs it with `chat.agentHost.wsl.autoStart`.
The recovery screen and the inline banner both render the checkbox and live
connect progress. The Start action is never rendered while an automatic start
is pending: the content derivation itself returns the connecting presentation,
so this holds structurally rather than depending on autorun ordering.
Two ordering bugs surfaced while building this.
A connect that resolved without reaching the host cleared the in-flight attempt
and re-opened the automatic gate, spinning forever behind a permanent "Waiting
for agent host connection...". The gate is now latched per outage and released
once the host is reachable, so a mid-session drop still gets its own attempt
while an ineffective connect does not retrigger.
The service fired its connection-change notification from inside a failing dial,
before clearing the in-flight marker. A consumer dialing from that notification
joined the dial that had just failed, so nothing reconnected and its
`waitForConnection` never settled. The marker is now cleared before notifying;
`_connectTo` clears by identity, so a dial started from the notification
survives.
Both are covered by regression tests that reproduce the original hangs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agent Host: show reconnect backoff and offer a manual retry
While a protocol client waits out its exponential backoff the banner now reads
"Reconnecting to <host> in 5s" and counts down, with a Try Now action that skips
the remaining delay.
Try Now accelerates the client's in-place retry rather than redialling, so the
outbox and session state survive. It falls back to a fresh dial only when there
is no client to accelerate, which happens now that a rejected factory retains a
client-less entry.
The backoff deadline travels on the `reconnecting` status. The client stays in
that state across rounds, so the deadline is refreshed through a dedicated
`onDidScheduleReconnect` event rather than by re-firing the connection-state
event: consumers of that event do real work per transition, and repeating it
each round would have unclear blast radius.
Also offers a Retry action on the generic "Cannot reach <host>" state, on both
the banner and the centered recovery surface. A tunnel that dies is usually
transient. This stays manual: unlike a stopped WSL distro there is nothing local
to start, so retrying automatically would only hammer an unreachable endpoint.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agent Host: address review feedback on remote connection state
Retaining a disconnected entry turned `connections` from a liveness list into a
status catalog, but three consumers still read presence as "connected": cloud
sandbox negative reconciliation would never tear down a failed environment, and
the cloud sandbox and Dev Container connect-failure paths would skip their
cleanup and leak a staged connection. Each now tests the status. Documented the
broadened semantics on the interface and removed an orphaned JSDoc block for an
accessor that no longer exists.
Reverted a stray `1.0.0` entry in the supported-protocol list. It broke the
registry's documented first-entry invariant against `PROTOCOL_VERSION` and the
handshake test, and had nothing to do with this work.
`setSession` now writes in one transaction. These observable writes notify
autoruns synchronously, so clearing the gates while the previous session was
still selected could start the host being switched away from.
The banner explains an incompatible host instead of staying silent. Once a
transcript is rendered the centered recovery state is skipped, leaving the
banner as the only surface, so suppressing it meant no explanation at all.
Accessibility: the banner's live region now announces dedicated text rather than
its visible text, so a per-second countdown no longer queues an utterance per
tick, and connect progress is announced as it advances.
Bootstrap progress discards a queued report before publishing an immediate one.
If the event loop stalled past the throttle interval, the stale pending value
could land after the newer one and make displayed progress run backwards.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agent Host: describe the automatic-start latch scope accurately
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agent Host: assign the session connection in the constructor
Its field initializer read _instantiationService, a parameter property of
the same class, which class-field semantics initialize after field
initializers run. Caught by define-class-fields-check.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Project learning inboxes
This directory holds reusable feedback that is not yet mature enough for an authoritative instruction, design document, skill, or regression test.
Learning files are bounded temporary inboxes, not permanent specifications or automatically loaded context. Follow the feedback-learning skill for selective reading, memory budgets, compaction, promotion, and garbage collection.
Each entry identifies its scope, generalized learning, supporting evidence, and intended disposition. Once promoted, remove the inbox entry in the same change.