AI Today

GitHub introduces the Agent Host Protocol so AI agent sessions keep running as you switch editor or device

· 3 min

In brief


GitHub describes the Agent Host Protocol (AHP), an open standard that lets agent sessions continue across editors, apps, phones and the cloud. Until now the agent in VS Code was an extension tied to the life of the window: closing it or updating VS Code ended the agent. AHP separates the agent from the client: an agent host runs the session and several clients see the same agents, history and state. A session started in the cloud from a phone can therefore be continued on a laptop. Today session continuity across VS Code and GitHub surfaces runs on AHP. Developers can build their own clients or hosts, with libraries in six languages. Whether the protocol spreads beyond Microsoft and GitHub is open.


Technically AHP is organised around URI-identified channels. Every server must implement root, session and chat channels and may add more for terminals, MCP additions or OTel reporting. Within each channel a reducer-based state object drives the logic: the server arbitrates the state, and clients send actions that mutate it or trigger side effects such as sending a chat message. On a poor network a client re-sends its queued actions and confirms them only once the server has reconciled them. The protocol deliberately avoids encoding how agents work and focuses on how people interact with them, because agents change fast.

Getting there was a large job. The Copilot Chat extension had grown for over three years to more than 400,000 lines of TypeScript and depended on the VS Code extension API. For a standalone host the team built a new agent stack on the Copilot SDK. GitHub's host has to run in the cloud and across many environments, so it is written in Rust, while VS Code's is in TypeScript. Comparing the two exposed gaps: early versions could not represent shell output not backed by a PTY, and VS Code's client assumed a particular structure for session URIs.

To try it, enable Experimental > Direct Connections in the Copilot app and add a host under Environments, or use "Add Remote Agent Host" in the VS Code Agents window. Running `code agent host` starts a standalone version of VS Code's host and `code agent endpoints` shows the endpoints of the one in your editor. The author mentions a macropad reflecting agent state, and says others have built smartwatch apps and kanban-style task tools. This is a developer post on GitHub's own blog, not an independent assessment.

Sources

Open in the interactive reader →

This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources. Imprint, privacy policy and terms of service