Back Home

AI 程式開發工具

VS Code Agent Host Moves the Agent Loop Out of Extensions, Using AHP to Synchronize Sessions Across Windows

VS Code 1.132 through 1.135 connect agents such as Copilot and Claude to a standalone Agent Host, allowing sessions to continue across windows, remote connections, and headless environments. The open Agent Host Protocol unifies session state, but not the reasoning, permissions, or tool behavior of individual models.

Software by Microsoft · Public domain · Image source
zh-Hant

On August 31, GitHub summarized the agent updates in VS Code 1.132 through 1.135. The central change is Agent Host: the agent runtime no longer has to be tied to the extension host of a single window. Instead, a standalone process maintains the session, harness adapter, and basic workspace capabilities. After the original folder or editor window is closed, agent turns can continue as long as the host remains running, and other VS Code windows or the Agents window can connect to the same state.

The local Agent Host runs as a utility process, while remote mode starts a standalone server on the machine hosting the workspace. The two sides communicate through the open Agent Host Protocol (AHP), using message ports locally and JSON-RPC over WebSocket remotely. The host is the source of truth for state. Clients subscribe to URI-addressed session, chat, terminal, and changeset channels, receive a snapshot first, and then apply ordered actions. After reconnecting, a client can retrieve missed actions or request a new snapshot.

AHP standardizes only the client-facing session layer; it does not define how models reason, compress context, or select tools. The Copilot adapter drives the agent through a Copilot SDK subprocess, while the Claude adapter maps sessions, tools, permissions, hooks, and subagents from the Claude Agent SDK. This allows multiple harnesses to share persistence and remote-operation interfaces while retaining vendor-specific capabilities.

The August releases also added `/btw` side conversations that share the main context and prompt cache, cross-application continuation of Copilot or Claude sessions, per-model displays of input, cached, and output tokens, and the experimental `/rubber-duck` second-model review. The latter acts as a read-only critic and does not modify files directly, but it increases latency and model usage.

The migration is not entirely transparent. Agent Host sessions modify folders or worktrees directly, unlike the pending edits awaiting acceptance in the old extension-host architecture. Tools contributed by extensions are available only while the client contributing those tools remains connected. The host also does not read `.vscode/mcp.json` directly; VS Code must forward it, and MCP servers that use interactive input variables might not be passed through. Before upgrading, teams should retest permissions, working directories, MCP configuration, reconnection recovery, and conflict semantics when multiple clients control the same session simultaneously.

Sources

  1. GitHub Copilot in VS Code, August 2026 releases
  2. Introducing the Agent Host for persistent, portable agent sessions
  3. VS Code Agent Host architecture