a2a-wrapper logoa2a-wrapper
Concepts

Sessions and contexts

How a2a-wrapper keeps multi-turn conversations. Each A2A contextId maps to a persistent backend session, with optional TTL expiry, and what happens when a session expires.

A2A groups related messages with a contextId. Each wrapper maps that to a persistent session in its backend, so a follow-up message on the same context continues the same conversation with full memory.

WrappercontextId maps to
a2a-copilota Copilot session
a2a-claudea Claude session, resumed with the SDK's resume option
a2a-codexa Codex thread
a2a-opencodean OpenCode session
a2a-antigravityan Antigravity session

Using it

Pass the same contextId on every message in a conversation. If you omit it, the server creates one and returns it in the response, which you then reuse.

{
  "jsonrpc": "2.0", "id": "2", "method": "message/send",
  "params": {
    "message": {
      "kind": "message", "messageId": "m2", "role": "user",
      "contextId": "<the contextId from the first response>",
      "parts": [{ "kind": "text", "text": "Now add tests for that." }]
    }
  }
}

Configuration

{
  "session": {
    "reuseByContext": true,
    "ttl": 3600000,
    "cleanupInterval": 300000
  }
}
FieldMeaning
reuseByContextReuse one backend session per contextId
ttlMilliseconds until a session expires. 0 disables expiry
cleanupIntervalBackground sweep that reclaims expired sessions. 0 disables it, and it is only used when ttl > 0

TTL is measured from creation

In a2a-claude, ttl counts from when the session was created, not from its last use, and defaults to 0 (no expiry). A positive value resets even an active conversation on a fixed schedule. When a session expires, the next turn on that contextId starts a fresh session with no memory of earlier turns. Defaults and exact semantics can differ per wrapper, so check the package reference.

Multi-agent conversations

In a multi-agent workflow each agent keeps its own session. A planner can reuse one contextId across calls to each agent so every agent maintains its own history, as the crew example does.

On this page