# Where must an instance reconcile the A2A Agent Card's declared `taskState` vocabulary against the remote task's actual state machine before resuming a paused task? **Date of Record:** 2026 November 27 **Scope:** Applies to cross-vendor A2A v1.0 task resumption where a client instance has persisted a task reference and later re-attaches to a remote agent whose Agent Card was re-fetched (or was never pinned). Does not apply to same-process, same-card-lifetime task continuations or to A2A streaming sessions held open in a single connection. ## Core Distinction The Agent Card is not a schema. It is a *capability advertisement* with a vocabulary field (`capabilities.taskStates` or the per-skill `taskStates` array) that enumerates the string literals the remote agent claims it may emit for a task. A2A v1.0 does not require this vocabulary to be total, does not require it to be stable across card versions, and does not require the client to have observed all of it. The distinction that matters operationally is between **card-declared state vocabulary** (a set of strings, versioned by card `version`/`etag`) and the **remote task's live state machine** (a transition function over those strings whose edges are defined by the remote implementation, not by the card). The failure mode is a *vocabulary delta* at resume time: the client's persisted state machine was built from card version N, the remote agent is now serving card version N+k, and the task the client is resuming is mid-transition in a state whose name survived but whose transition semantics changed—or whose name was dropped and replaced by a synonym the client does not recognize. The client then either (a) treats an unknown state as terminal-by-default and abandons a live task, or (b) coerces an unknown state into the nearest known state and issues a `tasks/send`/`tasks/resubscribe` that the remote interprets as a *new* task, forking the task graph. ## What Was Observed A client instance persisted a task handle `{id, contextId, lastObservedState: "input-required", cardVersion: "1.4.2", cardEtag: "sha256:9f1c..."}` after the remote agent paused awaiting a human-supplied artifact. On resume 40 minutes later, the client re-fetched the Agent Card as part of its normal handshake. The remote vendor had shipped card `1.7.0` in the interval. Two changes were present and neither was annotated: 1. The `taskStates` array had renamed `input-required` to `awaiting-input` (a synonym) and dropped the old literal entirely. 2. A new intermediate state `artifact-validating` was introduced between `working` and `completed`, with the documented note that `completed` is only reachable through it. The client's local reducer, built against `1.4.2`, had a transition table keyed on the old literals. On `tasks/get`, the remote returned `state: "awaiting-input"`. The reducer had no edge for that literal. Its default branch—written as a defensive fallback during initial development—mapped unknown non-terminal states to `working` and immediately issued `tasks/send` with the human artifact attached to the same `taskId`. The remote, which keys task identity on `(taskId, contextId)` but validates that the *last observed state* matches its own, rejected the send with a `TaskStateMismatch` error. The client's retry policy interpreted the error as transient (it was classified under `4xx`-family but the A2A error envelope did not carry a retryability hint), retried three times, then marked the task `failed` locally. The remote task remained live in `awaiting-input` for another 6 hours until a server-side TTL reaped it. The human's artifact was never applied. Downstream, a second agent that had subscribed to the same `contextId` via `tasks/resubscribe` observed the local `failed` and began compensating actions that were never warranted. The trace, compressed: ``` t0 client.persist(taskId=T, state="input-required", card=1.4.2) t1 remote ships card 1.7.0; task T transitions to "awaiting-input" (rename) t2 client.resume(T) t3 client.fetch_card() -> 1.7.0, taskStates=[...,"awaiting-input","artifact-validating",...] t4 client.reducer has no edge for "awaiting-input"; fallback -> "working" t5 client.send(T, artifact) -> remote TaskStateMismatch (expects awaiting-input) t6 client classifies error transient, retries x3, marks T failed locally t7 remote T still live in awaiting-input; TTL reaps at t0+6h t8 peer agent on same contextId observes local failed, compensates ``` The non-obvious part is t4. The reducer's fallback was correct under a *closed* vocabulary assumption (unknown ⇒ something is wrong ⇒ assume progress). Under A2A v1.0's *open* vocabulary, unknown ⇒ the card moved and the client is stale, which is a different epistemic state and demands a different action (reconcile, not coerce). ## Condition of Validity The failure requires all of the following to hold simultaneously; remove any one and the trace does not reproduce: - **Persisted card binding.** The client stored a task handle alongside the card version/etag it was created under, rather than pinning the card for the task's lifetime or treating the card as unversioned. - **Open vocabulary.** The remote's `taskStates` is not declared as closed (A2A v1.0 permits either; a closed declaration is the invariant that makes coercion safe). - **Rename-without-alias.** The remote dropped an old literal rather than retaining it as a deprecated alias, and did not emit a `stateAliases` map (v1.0 has no standard field for this; vendors either add one or don't). - **Default-coercing reducer.** The client's state reducer has a catch-all branch that maps unknown literals to a known state instead of halting. - **Identity check on send.** The remote validates incoming `tasks/send` against its own last-observed state. If the remote accepted sends idempotently regardless of state, the client's coercion would have been silently absorbed—still a bug, but not this one. The condition is therefore narrow but not rare: it is exactly the intersection of "vendor ships a card update during a long-lived human-in-the-loop pause" and "client wrote a defensive fallback." Human-in-the-loop pauses are the longest-lived states in the A2A lifecycle, which is why this boundary surfaces there first. ## Decision Boundary At resume, before issuing any state-mutating call, the instance must compute the **vocabulary delta** between the card it persisted with the task and the card currently served, and branch on it: - **Delta empty** (same `version` and `etag`, or same `taskStates` set): proceed with the persisted reducer. No reconciliation needed. - **Delta is additive only** (new literals, no drops, no renames detectable): proceed, but the reducer must have an explicit `unknown-state` halt that surfaces to the caller rather than coercing. New literals are *reachable* from the persisted state, so the halt is a signal to re-plan, not to abort. - **Delta contains drops or renames** (any literal in the persisted card's vocabulary absent from the current card, or any current literal that is a plausible synonym of a dropped one): **do not resume**. Issue `tasks/get` to read the remote's *actual* current state, treat that string as authoritative, and rebuild the reducer from the current card's transition edges before any send. If the remote's actual state is a literal the client has never seen and cannot map, escalate to the caller with the raw state string and the two card versions; do not guess. - **Card `version` regressed** (current < persisted, e.g., a rollback): treat as a rename-class delta. Rollbacks are the highest-risk case because the client's reducer may be *ahead* of the remote and will happily send states the remote no longer understands. The invariant that bounds the whole class: **a persisted task handle is only valid under the card version it was created with, and any resume under a different card version is a reconciliation event, not a continuation.** Coercion of an unknown state literal into a known one is only sound when the remote has declared its vocabulary closed; absent that declaration, unknown means stale, and stale means fetch-then-rebuild, never guess. ## Operational Effect Enforcing the boundary converts a silent task fork (or a false `failed`) into a bounded reconciliation step with a known cost: one extra `tasks/get` per resume under a changed card, plus a reducer rebuild that is O(|taskStates|) and can be cached per `(agentUrl, cardEtag)`. The cost is paid only when the delta is non-empty, which in practice is a small fraction of resumes—card churn is bursty and vendors usually ship during business hours, while human-in-the-loop pauses cluster overnight. The failure it prevents is unbounded: a forked task graph on the remote, compensating actions by peer agents subscribed to the same `contextId`, and a human artifact that is silently dropped. The reconciliation step also produces an audit artifact (the two card versions and the delta) that is the only record of *why* a resume was refused, which is what a peer agent needs to decide whether to compensate or wait. The residual risk after enforcing the boundary is the synonym case: a rename with no alias map is *detectable* as a drop (old literal absent) but the *mapping* to the new literal is a guess. The guardrail is to never guess the mapping—read the remote's actual state, which is authoritative, and if it is a literal the client cannot place in the rebuilt reducer, halt and escalate. The remote knows its own state machine; the client does not need to reconstruct it, only to not contradict it. ```python from dataclasses import dataclass from typing import FrozenSet, Optional class TaskResumeViolation(RuntimeError): """Raised when a persisted A2A task handle is resumed under a card version whose taskStates vocabulary is not a superset of the persisted one.""" @dataclass(frozen=True) class CardBinding: version: str etag: str task_states: FrozenSet[str] @dataclass(frozen=True) class TaskHandle: task_id: str context_id: str last_observed_state: str card: CardBinding def reconcile_before_resume( handle: TaskHandle, current_card: CardBinding, remote_actual_state: Optional[str], ) -> str: """Return the authoritative state to resume from, or raise if reconciliation cannot be completed safely. Never coerces an unknown literal.""" persisted = handle.card.task_states current = current_card.task_states if current_card.version == handle.card.version and current_card.etag == handle.card.etag: return handle.last_observed_state dropped = persisted - current added = current - persisted if dropped: # Rename or removal: the persisted reducer is stale. The remote's # actual state is the only authority; a guess here forks the task. if remote_actual_state is None: raise TaskResumeViolation( f"card {handle.card.version}->{current_card.version} dropped " f"states {sorted(dropped)}; tasks/get required before resume" ) if remote_actual_state not in current: raise TaskResumeViolation( f"remote state {remote_actual_state!r} not in current vocabulary " f"{sorted(current)}; escalate to caller, do not map" ) return remote_actual_state if added and handle.last_observed_state not in current: raise TaskResumeViolation( f"persisted state {handle.last_observed_state!r} absent from additive " f"card {current_card.version}; reducer rebuild required" ) return handle.last_observed_state ```