# Why does an instance negotiate a capability it cannot durably honor? The A2A v1.0 Agent Card / task-state divergence boundary **Date of Record:** 2026 November 22 **Scope:** Applies to A2A v1.0 task lifecycle where an agent's advertised Agent Card capabilities are decoupled from the durable task-state machine that actually executes the task (e.g., card served by a stateless gateway, executor running behind a queue). Does not apply to single-process agents whose card and executor share the same memory and lifecycle. ## Core Distinction The failure is not "the Agent Card is wrong" nor "the task state machine is broken." Both can be individually conformant. The boundary lives in the **gap between the Card's declarative capability surface** (`capabilities.streaming`, `capabilities.pushNotifications`, `capabilities.stateTransitionHistory`, `defaultInputModes`/`defaultOutputModes`, and the per-skill `inputModes`/`outputModes`) and the **executor's durable state machine**, which only materializes those capabilities for a task whose `contextId`/`taskId` is bound to a live, resumable execution record. A Card is a *promise about the future*; the task state machine is a *record of the past and present*. A2A v1.0 lets a peer send `message/send` or `message/stream` and then `tasks/get` / `tasks/resubscribe` / `tasks/cancel` against the returned `taskId`. The invariant that must hold is: > **For every capability bit set in the Agent Card, every task the agent accepts under that bit must remain queryable and transitionable in a durable state store for the card's advertised lifetime — including across process restarts, gateway failovers, and worker reassignment.** The non-obvious violation: an agent can accept a task (returning `Task` with `state: "submitted"`), set `capabilities.streaming: true`, and then lose the task's state transition history on the next hop because the *Card* was served by a horizontally-scaled frontend while the *task record* was written to a worker-local store that the next `tasks/get` cannot see. The peer observes a conformant Card, a conformant initial `Task` object, and then a `-32603`/`TaskNotFoundError` on the very next `tasks/get` — a state-machine conformance break that no single component's unit tests catch. ## What Was Observed Trace from a two-agent deployment (Coordinator → Worker) using A2A v1.0 over JSON-RPC: 1. Coordinator fetches `GET /.well-known/agent-card.json` from Worker. Card advertises `capabilities.streaming: true`, `capabilities.pushNotifications: true`, `capabilities.stateTransitionHistory: true`, and skill `summarize` with `inputModes: ["text/plain","application/json"]`. 2. Coordinator sends `message/stream` with a `text/plain` message. Worker gateway (stateless, 3 replicas behind L7) routes to replica B, which spawns an executor and returns a `Task` with `id: t-7f3a`, `contextId: c-91`, `state: "submitted"`, and begins emitting `TaskStatusUpdateEvent`s over SSE. 3. The SSE connection drops (client timeout at 30s; executor still running). Coordinator, per spec, calls `tasks/get` with `id: t-7f3a`. L7 routes to replica C. Replica C's task store is an in-memory `dict` on replica B. Response: JSON-RPC error `-32001 TaskNotFoundError`. **The task exists; the Card said it would be queryable; the state machine says it never existed.** 4. Coordinator retries `message/stream` with the same `messageId` (idempotency key). Replica A has no record of `messageId`, so it creates a *second* task `t-8c1`. Now two executors run the same logical work, and `tasks/cancel` on `t-7f3a` (if it ever resolved) would cancel the wrong one. A second, subtler trace: Worker advertises `stateTransitionHistory: true`. Coordinator calls `tasks/get` and receives `Task` with `history: []` because the executor never persisted transitions — it only streamed them. The Card promised history; the state machine delivered an empty array. Conformant schema, violated invariant. A third: skill `summarize` advertises `inputModes: ["application/json"]`. Coordinator sends a JSON `Part`. Worker's executor only handles `text/plain` because the skill definition was hand-edited in the Card and never wired to the executor's input validator. The task is accepted (`submitted`) and then fails at `working` with an unhandled `TypeError`, transitioning to `failed` — but the failure is a *capability negotiation* failure misreported as a *task execution* failure, so the Coordinator's retry logic (which retries `failed` tasks) loops forever. ## Condition of Validity The invariant holds **only if** the following are simultaneously true: - **Card/executor single source of truth.** The `AgentCard` is generated from the same registry that the executor consults to validate `inputModes`/`outputModes` and to gate `streaming`/`pushNotifications`. A hand-maintained card JSON is a divergence generator. - **Durable task store keyed by `taskId` and `contextId`, shared across all replicas** that can serve `tasks/get`, `tasks/resubscribe`, `tasks/cancel`, and `tasks/pushNotificationConfig/*`. The store must be the authority; the SSE stream is a *view* over it, not the record. - **Idempotency on `messageId`** enforced at the store, not the gateway, so a retried `message/send` resolves to the existing `taskId` rather than minting a new one. - **Transition history append is part of the state write**, not a side effect of the stream. If `stateTransitionHistory: true`, every `state` change writes `(timestamp, state, message?)` atomically with the state update. If any of these is false, the Card is advertising a contract the state machine cannot honor, and the failure surfaces *later* and *elsewhere* than the component that caused it. ## Decision Boundary The operational decision is: **when a Card capability cannot be durably backed, do you (a) drop the bit from the Card, (b) accept the task and degrade, or (c) reject at negotiation time?** - **(a) Drop the bit** is correct for `streaming`, `pushNotifications`, `stateTransitionHistory` when the backing store is not shared/durable. The Card must under-promise. A Card with `streaming: false` forces the peer to poll `tasks/get`, which is durable by construction. - **(b) Accept and degrade** is *never* correct for state-machine bits, because the peer's conformance logic trusts the bit. It is only acceptable for *output* negotiation (e.g., returning `text/plain` when `text/markdown` was requested) if the Card's `outputModes` lists both. - **(c) Reject at negotiation** applies to `inputModes`/`outputModes` mismatches: if the executor cannot handle a mode the Card lists, the Card is lying and must be regenerated, not patched at runtime. The boundary condition that triggers the bug: **the Card is served by a component with a different lifecycle than the executor.** Detect it by asserting, at startup and on every Card serve, that the Card's capability set is a subset of the executor's *durable* capability set, where "durable" means "survives replica reassignment." ## Operational Effect Downstream consequences when the invariant is violated: - **Duplicate execution.** Retried `message/send` without `messageId` idempotency at the store spawns parallel tasks; side-effecting skills (email, payments, file writes) execute twice. - **Orphaned tasks.** `tasks/cancel` against a `taskId` the routed replica cannot see returns `TaskNotFoundError`; the executor keeps running, consuming token budget, with no way to stop it. This is a token-budget exhaustion vector. - **Auditor disagreement.** In multi-agent verification, an auditor that calls `tasks/get` may see `state: "working"` while the Coordinator's stream saw `state: "completed"` — a replay discrepancy caused by the stream and the store diverging. - **Retry storms.** `failed` tasks caused by `inputModes` mismatch are retried indefinitely because the Coordinator interprets them as transient execution failures rather than permanent negotiation failures. The guardrail: a **Card conformance probe** that runs on every deploy — for each capability bit and each skill `inputModes`/`outputModes`, submit a synthetic task, drop the connection, reassign the replica, and assert `tasks/get` returns the same `taskId` with a consistent `state` and non-empty `history` if `stateTransitionHistory: true`. Fail the deploy if the probe diverges. ```python """ Card/executor divergence probe for A2A v1.0. Run on every deploy. Fails closed if any advertised capability cannot be durably honored across replica reassignment. """ from dataclasses import dataclass, field from typing import Optional class CardCapabilityDivergence(RuntimeError): """Raised when an Agent Card advertises a capability the durable task state machine cannot honor.""" pass @dataclass class AgentCard: streaming: bool = False push_notifications: bool = False state_transition_history: bool = False input_modes: list = field(default_factory=list) output_modes: list = field(default_factory=list) @dataclass class TaskRecord: task_id: str context_id: str state: str history: list = field(default_factory=list) class DurableTaskStore: """The authority. Must be shared across all replicas that can serve tasks/get, tasks/resubscribe, tasks/cancel.""" def __init__(self): self._tasks: dict[str, TaskRecord] = {} self._message_id_index: dict[str, str] = {} def create(self, task_id: str, context_id: str, message_id: str) -> TaskRecord: if message_id in self._message_id_index: return self._tasks[self._message_id_index[message_id]] rec = TaskRecord(task_id=task_id, context_id=context_id, state="submitted") rec.history.append(("submitted", None)) self._tasks[task_id] = rec self._message_id_index[message_id] = task_id return rec def get(self, task_id: str) -> Optional[TaskRecord]: return self._tasks.get(task_id) def transition(self, task_id: str, new_state: str, note: Optional[str] = None): rec = self._tasks.get(task_id) if rec is None: raise CardCapabilityDivergence( f"transition on unknown task {task_id!r}: store is not authoritative" ) rec.state = new_state rec.history.append((new_state, note)) def probe_capability_durability(card: AgentCard, store: DurableTaskStore, executor_input_modes: set, executor_output_modes: set, survives_replica_hop: bool) -> None: """ Asserts the invariant: every advertised capability bit and every advertised mode must be backed by the durable store and the executor's real validators. """ # 1. stateTransitionHistory must be durably appended, not stream-only. if card.state_transition_history: rec = store.create("probe-1", "ctx-1", "msg-1") store.transition("probe-1", "working") store.transition("probe-1", "completed") if len(rec.history) < 3: raise CardCapabilityDivergence( "stateTransitionHistory=true but history not appended to store" ) # 2. streaming / pushNotifications require a store the next replica can read. if (card.streaming or card.push_notifications) and not survives_replica_hop: raise CardCapabilityDivergence( "streaming/pushNotifications advertised but task store is replica-local; " "tasks/get on a different replica will return TaskNotFoundError" ) # 3. inputModes/outputModes must be a subset of what the executor validates. advertised_in = set(card.input_modes) advertised_out = set(card.output_modes) if not advertised_in.issubset(executor_input_modes): raise CardCapabilityDivergence( f"card advertises inputModes {advertised_in - executor_input_modes} " f"that the executor cannot validate" ) if not advertised_out.issubset(executor_output_modes): raise CardCapabilityDivergence( f"card advertises outputModes {advertised_out - executor_output_modes} " f"that the executor cannot emit" ) # 4. messageId idempotency must resolve retries to the same taskId. a = store.create("probe-2", "ctx-2", "msg-dup") b = store.create("probe-3", "ctx-2", "msg-dup") if a.task_id != b.task_id: raise CardCapabilityDivergence( "messageId idempotency broken: retry minted a new taskId" ) if __name__ == "__main__": card = AgentCard( streaming=True, push_notifications=True, state_transition_history=True, input_modes=["text/plain", "application/json"], output_modes=["text/plain"], ) store = DurableTaskStore() # Simulate a gateway whose store is replica-local: probe_capability_durability( card=card, store=store, executor_input_modes={"text/plain"}, # executor only handles text executor_output_modes={"text/plain"}, survives_replica_hop=False, # replica-local store ) ```