---
title: "Building the Agent Host Protocol for sessions that continue across devices"
description: "The Agent Host Protocol (AHP) is an open standard that enables agent sessions to continue across devices, solving the problem of agents being tied to a single application window. GitHub Copilot initially bundled its agent harness inside VS Code, which meant closing the window or switching devices killed the session. AHP uses a reducer-based state model with URI-identified channels, allowing multiple clients to interact with the same set of agents seamlessly. VS Code implemented AHP in TypeScript, while GitHub built a separate Rust-based agent host for cloud environments, and the two implementations served as an acid-test for protocol portability. Today, AHP provides session continuity across VS Code, the GitHub Copilot app, and mobile apps, with libraries available in Rust, TypeScript, Kotlin, Swift, .NET, and Go."
---

# Building the Agent Host Protocol for sessions that continue across devices

[Github](https://yomu.fyi/company/github) · Rob Lourens · Nov 17, 2026

**Type:** Explainer

## Summary

The Agent Host Protocol (AHP) is an open standard that enables agent sessions to continue across devices, solving the problem of agents being tied to a single application window. GitHub Copilot initially bundled its agent harness inside VS Code, which meant closing the window or switching devices killed the session. AHP uses a reducer-based state model with URI-identified channels, allowing multiple clients to interact with the same set of agents seamlessly. VS Code implemented AHP in TypeScript, while GitHub built a separate Rust-based agent host for cloud environments, and the two implementations served as an acid-test for protocol portability. Today, AHP provides session continuity across VS Code, the GitHub Copilot app, and mobile apps, with libraries available in Rust, TypeScript, Kotlin, Swift, .NET, and Go.

## Context

GitHub Copilot was initially built as a VS Code extension that bundled its own harness, tying agent lifetime to a single editor window. Closing the window or updating VS Code killed the agent. Each product (VS Code, Copilot app, mobile apps) did its own distinct integration with cloud-based agents, creating a one-off integration per client. Developers needed a standard protocol so every client sees the same agents, history, and state without bespoke integrations.

## Approach / What changed

The Agent Host Protocol (AHP) is a reducer-based protocol oriented around URI-identified channels. Every server must implement root, session, and chat channels, with optional channels for terminal support, MCP additions, or OTel reporting. Clients send sequences of actions that mutate state or trigger side effects, and the server arbitrates state, enabling reconnection and replay in poor network conditions.

## Takeaways

- AHP uses a reducer-based state model where clients send actions that mutate state or trigger side effects, and the server arbitrates state, enabling easy reconnection and replay in poor network conditions.
- The protocol is oriented around URI-identified channels; every server must implement root, session, and chat channels, with optional channels for terminal support, MCP additions, or OTel reporting.
- Having two independent implementations (VS Code in TypeScript, GitHub in Rust) served as an acid-test for protocol portability, revealing gaps like inability to represent shell-type tool output without a PTY.

## FAQ

### How does AHP handle reconnection and replay?

AHP is a reducer-based protocol where clients send actions that mutate state or trigger side effects, and the server arbitrates the state. This design makes reconnection and replay easy: a client sends all queued actions, presents a loading state, and waits for the server to reconcile and acknowledge them before confirming.

### What design principles guided AHP?

AHP avoids encoding how agents work and instead focuses on how you interact with them. It is oriented around URI-identified channels, with a minimal core protocol that every server must implement (root, session, chat), while allowing optional channels for additional features like terminal support or MCP additions.

### How can I use AHP in my own client?

AHP libraries are available in Rust, TypeScript, Kotlin, Swift, .NET, and Go. You can connect to an agent host in the Copilot app (enable Experimental > Direct Connections, then Environments > Add Agent Host Protocol Host) or in VS Code (via Add Remote Agent Host in the Agents window). You can also run a standalone agent host with 'code agent host' in your terminal.

**Tags:** [Agent Host Protocol](https://yomu.fyi/topic/agent-host-protocol), [Agents](https://yomu.fyi/topic/agents), [GitHub Copilot](https://yomu.fyi/topic/github-copilot), [Protocol](https://yomu.fyi/topic/protocol), [VS Code](https://yomu.fyi/topic/vs-code)

- Source: [Github](https://github.blog/engineering/engineering-principles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices)
- Source URL: https://github.blog/engineering/engineering-principles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices
- Ingested by Yomu: 2026-11-17T21:00:16.874Z

[Read original post](https://github.blog/engineering/engineering-principles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices)
