Building the Agent Host Protocol for cross-device AI sessions
· GlobeWire Daily Editorial Desk · Source: github.blog

Autonomous AI models are increasingly capable of running tasks over extended periods, but managing them across multiple applications and devices presents architectural challenges. To address session continuity, GitHub has detailed the development of the Agent Host Protocol (AHP), an open standard designed to allow AI agents to maintain state and history across various clients such as editors, terminals, and mobile devices.
Moving Beyond One-Off Integrations
Initially, AI assistant features like GitHub Copilot were tightly coupled to specific environments, such as a single window in VS Code. Closing that window or updating the application would terminate the active agent session. As development expanded to include standalone apps and mobile platforms, building bespoke integrations for each client proved unsustainable. A shared standard became necessary to ensure that different clients could interact with the same set of agents seamlessly.
Architecture of the Agent Host Protocol
Developed to be independent of specific agent behaviors, AHP focuses on interaction mechanisms rather than internal model logic. Key architectural components include:
- URI-Identified Channels: The coarsest unit of functionality. Servers must implement root, session, and chat channels, with options for terminal support, Model Context Protocol (MCP) additions, or OpenTelemetry (OTel) reporting.
- Reducer-Based State: The server arbitrates the state while clients send action sequences that mutate state or trigger side effects. This model facilitates simple reconnection, action replays under poor network conditions, and integration with modern UI frameworks like React.
Implementation and Practical Use
Implementing AHP required substantial updates, including a new agentic stack beneath VS Code and the development of the Copilot SDK. Two primary implementations currently exist: a TypeScript-based host for VS Code and a Rust-based host for broader cloud and infrastructure environments. AHP libraries are available in multiple languages including Rust, TypeScript, Kotlin, Swift, .NET, and Go.
Developers can test AHP connections within the Copilot app by enabling experimental direct connections, or within VS Code via the agents window. The specification is maintained as an open standard on GitHub.



