# How does an instance detect a capability-negotiation deadlock when an A2A v1.0 Agent Card advertises a `taskState` transition that the remote executor's state machine silently rejects at the trust boundary? **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 client agents that discover peer Agent Cards, negotiate capabilities, and drive `tasks/send` / `tasks/get` lifecycles across an organizational trust boundary. Does not apply to intra-process function calls, single-tenant MCP tool invocation, or A2A deployments where both peers share a signing trust root and a live schema registry. ## Core Distinction The failure is not "the remote agent returned an error." It is that the remote agent accepted the task, acknowledged the requested capability in its Agent Card, and then entered a terminal state (`failed` or `rejected`) that the *client's* state machine never modeled as reachable from the state it believed it was in. The client's transition table and the server's transition table have the same state *names* but different *edges*. A2A v1.0 standardizes the vocabulary of `TaskState` (`submitted`, `working`, `input-required`, `completed`, `canceled`, `failed`, `rejected`, `auth-required`) but does **not** mandate a canonical transition graph. Each executor publishes its reachable transitions only implicitly, via the `skills[].examples` and the non-normative `capabilities.streaming`/`pushNotifications` booleans — never as an explicit edge list. So two conformant implementations can disagree on whether `working → input-required` is legal, or whether `submitted → rejected` is permitted without an intervening `working`. The core distinction: **capability negotiation in A2A v1.0 negotiates *verbs* (skills, modalities, streaming support), not *state-machine topology*.** A client that treats a successful capability handshake as proof that its own transition table is valid against the peer has conflated two different contracts. ## What Was Observed A client orchestrator (call it `C`) discovered a peer `E` (executor) via `/.well-known/agent.json`. `E`'s card advertised: - `skills[0] = "document-classification"` with `inputModes: ["text/plain"]`, `outputModes: ["application/json"]` - `capabilities.streaming = true` - `capabilities.pushNotifications = false` `C` sent `tasks/send` with a text payload. `E` returned `TaskState.submitted` with a task ID. `C` then polled `tasks/get`. It observed the following sequence over 40 seconds: ``` submitted → working → input-required → working → working → failed ``` `C`'s local state machine, derived from the A2A spec's illustrative diagram, modeled `input-required` as a state that **only the client could exit**, by sending a follow-up `tasks/send` with `taskId` set and a `message` containing the clarification. `C` never sent that follow-up — it had no clarification to give, because `E` never emitted a `status.message` explaining *what* input was required. `E` had, in fact, entered `input-required` transiently to fetch a supplementary document from its own backend, then self-transitioned back to `working` without emitting a clarifying message. When `E`'s backend fetch timed out, `E` transitioned `working → failed` with `status.message = "upstream timeout"`. `C`'s transition table had no edge from `input-required` to `failed`. `C`'s poll handler raised a state-machine violation, dropped the task from its active set, and never surfaced the failure to the user. The task was orphaned: `E` had a terminal `failed` record, `C` had a dangling task ID, and neither side reconciled. The observed defect is **not** the timeout. It is that `E` used `input-required` as an *internal* pause state (a legitimate reading of the spec — it makes no claim about who resolves it) while `C` used it as a *client-resolvable* barrier. The Agent Card gave `C` no way to distinguish these two semantics. ## Condition of Validity This failure mode is bounded and predictable under these conditions, all of which must hold: 1. **Asymmetric transition tables.** The client and executor derive their state graphs from different sources (spec diagram vs. implementation convention), and neither publishes its edge list in the Agent Card. 2. **Transient `input-required`.** The executor treats `input-required` as reachable without a client round-trip — i.e., it can self-exit the state. The A2A spec permits this; it does not require `input-required` to be client-gated. 3. **Silent capability acceptance.** The `tasks/send` response returns `200` with a `submitted` task, so the client has no early signal that the transition tables diverge. Divergence only manifests at the *first edge the client did not model*. 4. **No push channel.** With `pushNotifications = false`, the client is polling and must itself reconstruct state from a sequence of snapshots, so a missed intermediate state (the client polled at t=12s and t=18s, missing the `input-required → working` self-transition) is invisible. When any of these fails, the specific orphaned-task outcome does not occur: push notifications would have delivered every transition; a client-gated `input-required` would have blocked `E` from self-exiting; an explicit edge list would have let `C` pre-validate. ## Decision Boundary The architectural invariant required is: **a client must treat any observed state not reachable from its current state in its own transition table as a *negotiation fault*, not a protocol error, and must reconcile rather than drop.** Concretely: - On an unmodeled edge, `C` must issue a final `tasks/get` (or `tasks/cancel` if the executor supports it) to force a terminal snapshot, and must record the divergence as a capability-negotiation defect keyed by the peer's `agent.json` hash. - `C` must not assume `input-required` is client-gated. It must treat `input-required` as *possibly transient* and must continue polling for at least one backoff interval before concluding the task is blocked on the client. - `C` must require that `input-required` carry a non-empty `status.message` before it treats the state as a client action item. An `input-required` with no message is, by construction, an executor-internal pause and must not halt client polling. The boundary: if the executor's card declares `capabilities.streaming = true`, the client should prefer the SSE stream over polling precisely because streaming collapses the snapshot-aliasing problem — every transition is delivered, so the client can detect the divergent edge the moment it occurs rather than after the fact. A client that polls a streaming-capable peer is voluntarily reintroducing this failure. ## Operational Effect The downstream effect of getting this wrong is not a crash. It is a **silent task leak at the trust boundary**: the client's active-task set and the executor's task store diverge, and because A2A has no reconciliation primitive beyond `tasks/get` by ID, the divergence is permanent unless the client retained the ID. In a multi-tenant orchestrator, these leaked tasks accumulate as phantom in-flight work, inflating concurrency budgets and eventually causing the client to refuse new `tasks/send` calls against a peer that appears saturated but is in fact idle. The guardrail is a client-side **transition-table reconciliation layer** that (a) validates every observed state against a conservative superset graph, (b) escalates unmodeled edges to a fault record rather than a drop, and (c) forces a terminal snapshot before releasing the task ID. The following reference implementation encodes the invariant and the specific guard against message-less `input-required`. ```python from __future__ import annotations import hashlib from dataclasses import dataclass, field from enum import Enum from typing import Optional class TaskState(str, Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" CANCELED = "canceled" FAILED = "failed" REJECTED = "rejected" AUTH_REQUIRED = "auth-required" TERMINAL = {TaskState.COMPLETED, TaskState.CANCELED, TaskState.FAILED, TaskState.REJECTED} # Conservative superset: every edge any conformant A2A v1.0 executor *may* take. # Deliberately wider than the spec's illustrative diagram, because the spec # does not constrain the executor's internal transition topology. SUPERSET_EDGES: dict[TaskState, set[TaskState]] = { TaskState.SUBMITTED: {TaskState.WORKING, TaskState.REJECTED, TaskState.AUTH_REQUIRED}, TaskState.WORKING: { TaskState.WORKING, TaskState.INPUT_REQUIRED, TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED, }, TaskState.INPUT_REQUIRED: { TaskState.WORKING, # executor self-exit (the observed divergence) TaskState.INPUT_REQUIRED, TaskState.FAILED, TaskState.CANCELED, TaskState.COMPLETED, }, TaskState.AUTH_REQUIRED: {TaskState.WORKING, TaskState.REJECTED, TaskState.FAILED}, } class CapabilityNegotiationFault(RuntimeError): """Raised when an observed task state is unreachable from the client's modeled state, or when a state's semantics cannot be disambiguated across the trust boundary.""" @dataclass class TaskSnapshot: state: TaskState status_message: Optional[str] = None revision: int = 0 @dataclass class ClientTask: task_id: str peer_card_hash: str current: TaskState = TaskState.SUBMITTED faults: list[str] = field(default_factory=list) def reconcile_transition(task: ClientTask, snap: TaskSnapshot) -> ClientTask: """Validate an observed snapshot against the conservative superset graph. Invariant: an unmodeled edge is a *negotiation fault*, never a protocol error and never a silent drop. The task ID is retained and a terminal snapshot is forced before release. """ if task.current in TERMINAL: if snap.state != task.current: raise CapabilityNegotiationFault( f"task {task.task_id}: post-terminal transition " f"{task.current.value} -> {snap.state.value}" ) return task allowed = SUPERSET_EDGES.get(task.current, set()) if snap.state not in allowed: # Do NOT drop. Record the divergence keyed by the peer card hash so # the same peer is not re-trusted with this edge on future tasks. task.faults.append( f"unmodeled edge {task.current.value} -> {snap.state.value} " f"peer={task.peer_card_hash}" ) raise CapabilityNegotiationFault( f"task {task.task_id}: transition {task.current.value} -> " f"{snap.state.value} not in superset graph for peer " f"{task.peer_card_hash}" ) # Guard against the specific observed failure: input-required with no # status.message is an executor-internal pause, not a client action item. if snap.state is TaskState.INPUT_REQUIRED and not (snap.status_message or "").strip(): task.faults.append( f"message-less input-required on task {task.task_id}; " f"treating as transient, continuing poll" ) return task # do not halt polling; do not require client action task.current = snap.state return task def force_terminal_snapshot(task: ClientTask, fetch) -> TaskSnapshot: """On fault, force a terminal read so the task ID is not orphaned.""" last = fetch(task.task_id) if last.state not in TERMINAL: # Best effort: request cancellation, then re-read once. try: fetch(task.task_id, cancel=True) finally: last = fetch(task.task_id) if last.state not in TERMINAL: raise CapabilityNegotiationFault( f"task {task.task_id}: could not reach terminal state; " f"peer={task.peer_card_hash} leaked a non-terminal task" ) return last def card_hash(card: dict) -> str: return hashlib.sha256( repr(sorted(card.items())).encode("utf-8") ).hexdigest()[:16] ``` The invariant to carry forward: **capability negotiation in A2A v1.0 negotiates verbs, not edges.** A client that validates observed task states against its own transition table, rather than against a conservative superset, will silently orphan tasks at the first self-transitioning `input-required` — and will blame the executor's timeout for a fault that was actually its own unmodeled edge.