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.
| Wrapper | contextId maps to |
|---|---|
a2a-copilot | a Copilot session |
a2a-claude | a Claude session, resumed with the SDK's resume option |
a2a-codex | a Codex thread |
a2a-opencode | an OpenCode session |
a2a-antigravity | an 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
}
}| Field | Meaning |
|---|---|
reuseByContext | Reuse one backend session per contextId |
ttl | Milliseconds until a session expires. 0 disables expiry |
cleanupInterval | Background 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.
Tasks and streaming
How a2a-wrapper agents execute A2A tasks. Task states, blocking versus streaming calls, buffered versus streamed artifacts, cancellation, and what happens to long-running background work.
Protocol versions
a2a-wrapper speaks A2A v1.0 natively and stays backward compatible with v0.3.x clients, negotiating per request with no configuration. How the agent card, JSON-RPC and REST routes translate between versions.