# What structural signals indicate a terminal-state divergence in A2A v1.0 task lifecycles when agent card capability negotiation succeeds but execution-context versioning silently forks **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 task state machines where a client agent discovers a remote agent card, negotiates capabilities, and dispatches a task whose lifecycle spans multiple `TaskStatusUpdateEvent` transitions across vendor boundaries. Does not apply to single-vendor intra-process agent calls or to A2A streams that never leave `submitted`/`working`. ## Core Distinction The failure that matters here is not negotiation failure. It is *negotiation success followed by lifecycle divergence*. In A2A v1.0, capability negotiation is a one-shot handshake over the agent card: the client reads `capabilities`, `skills`, and `defaultInputModes`/`defaultOutputModes`, then dispatches. But the agent card is a **snapshot with no versioned binding to the execution context** the remote agent will actually instantiate when it transitions `submitted → working`. The card advertises *what the agent can accept*, not *which state-machine revision will govern the task's terminal transitions*. When two vendors ship cards that are individually well-formed and mutually acceptable, but their `TaskState` transition graphs disagree on which states are terminal, which transitions are legal from `input-required`, or whether `canceled` is reachable from `working`, negotiation passes and the lifecycle forks silently. The non-obvious part: the divergence is invisible until a *non-linear* transition is attempted — resumption from `input-required`, cancellation mid-`working`, or rejection after partial artifact emission. Linear happy paths (`submitted → working → completed`) mask it entirely, which is why it survives integration testing. ## What Was Observed A client agent (Vendor A) discovered a remote card (Vendor B) advertising `capabilities.streaming: true` and a skill with `inputModes: ["text/plain"]`. Negotiation returned `accepted`. The client dispatched a task and received `submitted`. The remote transitioned to `working`, then emitted `TaskStatusUpdateEvent { state: "input-required", final: false }` requesting a clarification token. The client, per its local state machine, treated `input-required` as **resumable and non-terminal**, held the task open, and sent `TaskSendMessage` with the clarification. The remote agent's state machine, however, had been instantiated from a *different* card revision than the one the client negotiated against — the card had been hot-swapped between discovery and dispatch (a deploy, a blue/green flip, or a per-tenant card variant). The new revision's machine treated `input-required` as **terminal-adjacent**: a `TaskSendMessage` arriving after `input-required` with `referenceTaskIds` unset was rejected as a new task, not a resumption. Result trace: 1. Client holds task `T` in local state `input-required` (resumable). 2. Remote has already transitioned `T → failed` internally after a TTL, emitting a `TaskStatusUpdateEvent { state: "failed", final: true }` that the client's stream handler classified as *stale* because it arrived after the client had already sent its resumption message and was awaiting a `working` echo. 3. Client's resumption `TaskSendMessage` lands on a task the remote considers terminal. Remote returns `TaskNotFoundError` (or, worse, a `200` with a *new* task id if the remote is lenient), and the client now has two task ids for one logical unit of work — a **lifecycle fork**. 4. The client's `Task` object retains the old id, the old `input-required` state, and the clarification payload it already sent. The remote's new task has neither. The structural signal was a `TaskStatusUpdateEvent` whose `final: true` arrived *after* the client had already committed a resumption write — an ordering that the client's state machine permitted but the remote's did not. Neither card advertised the ordering constraint. The `capabilities` object has no field for "terminal-state semantics" or "resumption window." ## Condition of Validity This divergence is *only* observable and actionable under three simultaneous conditions: - **The task enters a non-linear state** (`input-required`, `auth-required`, or a partial-artifact `working` that requires a follow-up write). Linear tasks never expose the fork. - **The remote card is not pinned to a revision.** If the client caches the card with an `ETag`/`If-None-Match` and the remote honors `304` on unchanged cards, the negotiated card and the dispatched card are provably the same revision. Without pinning, "same card" is an assumption, not an invariant. - **The client's stream handler and its write path are not serialized against the same task-id lock.** If the client serializes `TaskStatusUpdateEvent` processing and `TaskSendMessage` emission through one mutex keyed on task id, the ordering that produced the fork cannot occur — the resumption write blocks until the terminal event is consumed, and the client sees `failed: final` before committing. If any of the three fails, the failure is either unobservable (linear path), provably absent (pinned card), or structurally impossible (serialized handler). The invariant to enforce is the conjunction. ## Decision Boundary The boundary is: **a client may treat `input-required` as resumable only if it holds a card revision that is provably identical to the revision governing the remote's live task, AND its resumption write is serialized after the last consumed `TaskStatusUpdateEvent` for that task id.** Concretely, the client must choose between two postures at negotiation time, not at resumption time: - **Pinned posture:** cache the card with `ETag`, refuse to dispatch if the remote returns a card whose `ETag` differs from the negotiated one at any point during the task's life, and treat `input-required` as resumable. Cost: card hot-swaps abort in-flight tasks; you pay a retry. - **Unpinned posture:** never treat `input-required` as resumable without a `referenceTaskIds` echo from the remote confirming the task id. Cost: every resumption is a round-trip, and lenient remotes that mint new task ids on unknown references will still fork — so this posture additionally requires the client to reject any resumption response whose `task.id` differs from the original. The wrong choice — the one that produces silent forks — is to negotiate unpinned but *assume* pinned semantics at resumption. That is the default behavior of most A2A client SDKs, because the card's `capabilities` object gives no signal that pinning is required. ## Operational Effect Downstream, the fork manifests as **duplicate side effects**: the remote's new task re-executes the skill (re-sends an email, re-charges a card, re-writes a file), while the client's original task object is orphaned with a stale `input-required` state that will never resolve. The client's observability shows one task; the remote's billing shows two. Reconciliation requires a `tasks/get` on both ids and a manual merge, which the A2A spec does not define. The guardrail is a **card-revision witness** carried on every task-scoped write: the client attaches the negotiated card's `ETag` (or a hash of the `capabilities` + `skills` block) as a header or metadata field; the remote rejects writes whose witness does not match its live card revision with a typed `CardRevisionMismatchError`. This converts a silent fork into a loud, retryable abort. It is not in A2A v1.0; it must be layered on top via metadata extension, and both peers must agree to honor it. Absent that agreement, the only safe posture is the serialized-handler + task-id-echo combination above, which bounds the fork to a detectable `task.id` mismatch rather than a silent duplicate. ```python class CardRevisionDivergenceError(RuntimeError): """Raised when a task-scoped write targets a card revision other than the one negotiated.""" pass class LifecycleForkError(RuntimeError): """Raised when a resumption response mints a task id differing from the original.""" pass def dispatch_resumption( negotiated_card_etag: str, live_card_etag: str, original_task_id: str, resumption_response: dict, handler_locked: bool, ) -> dict: if not handler_locked: # The stream handler and the write path must share a task-id mutex; # otherwise a terminal event can race the resumption write. raise CardRevisionDivergenceError( f"resumption for task {original_task_id} not serialized against " f"TaskStatusUpdateEvent handler; fork window open" ) if negotiated_card_etag != live_card_etag: # Card hot-swapped between discovery and dispatch; terminal-state # semantics are no longer provably the ones we negotiated. raise CardRevisionDivergenceError( f"task {original_task_id}: negotiated card etag {negotiated_card_etag!r} " f"!= live {live_card_etag!r}; input-required resumability unverified" ) returned_id = resumption_response.get("task", {}).get("id") if returned_id != original_task_id: # Remote minted a new task on an unknown reference; duplicate side # effects are now in flight under two ids. raise LifecycleForkError( f"resumption of {original_task_id} returned task id {returned_id!r}; " f"lifecycle forked, reconcile before retry" ) return resumption_response ```