Menu
GitHub Engineering·November 17, 2026

Designing the Agent Host Protocol for Cross-Device AI Session Continuity

This article details the Agent Host Protocol (AHP), an open standard developed by GitHub to enable AI agent sessions to persist and continue across multiple devices and client applications. It addresses the challenges of tightly coupled agent lifecycles within specific applications and proposes a protocol-based solution for seamless, independent, and flexible agent interaction, supporting diverse client implementations and cloud-based agents.

Read original on GitHub Engineering

The Problem: Tied Agent Lifecycles and Bespoke Integrations

Initially, AI agents like GitHub Copilot were tightly integrated with specific client applications (e.g., VS Code extensions). This architecture meant an agent's lifecycle was bound to the application window, leading to session loss upon closing the app or switching devices. Furthermore, supporting agents across multiple platforms (VS Code, mobile, web app) required custom, one-off integrations for each client, leading to significant development overhead and limiting developer flexibility.

ℹ️

Architectural Challenge

How do you design a system where an AI agent's state and session can persist and be accessed consistently across a multitude of client applications and devices, without requiring N*M integrations?

Solution: The Agent Host Protocol (AHP)

The Agent Host Protocol (AHP) was developed as an open standard to decouple agent sessions from client applications. It acts as a standardized language for clients and servers to interact with agents, ensuring a consistent view of agents, history, and state regardless of the client or device. This protocol allows for starting an agent session on one device and seamlessly continuing it on another, even tolerating network interruptions and concurrent client interactions.

Core Design Principles of AHP

  • Client-agnostic: Supports multiple clients (VS Code, mobile, custom tools) interacting with the same agents.
  • Session Continuity: Enables agents to persist and be resumed across devices and network disruptions.
  • Agent Behavior Agnostic: The protocol focuses on *how to interact* with agents, not *how agents work*, allowing for rapid evolution of agent capabilities.
  • Simplicity & Extensibility: Minimal core protocol, easy to implement, with escape hatches for custom methods and metadata for domain-specific extensions.
  • Reducer-based State: Utilizes URI-identified "channels" with reducer-based state objects, where the server is the state arbiter. Clients send actions, and the server reconciles them, simplifying reconnection and debugging.

Implementation and Validation

GitHub implemented AHP with two distinct agent hosts: one in TypeScript for VS Code (running locally or remotely via SSH/WSL) and another in Rust for cloud-based GitHub Agents. This dual implementation by different teams served as an effective "acid test" for the protocol's portability and robustness, proving its ability to support diverse requirements and environments. The successful adoption across all VS Code and GitHub surfaces validates AHP's design for cross-device agent session continuity.

protocolsAPI designsession managementdistributed stateAI agentsmulti-clientdeveloper toolsGitHub Copilot

Comments

Loading comments...