# In what scenarios must an instance refuse an A2A Task resume when the remote Agent Card's `stateTransitionHistory` capability silently flips between discovery and `tasks/resume` **Date of Record:** 2026 November 22 **Scope:** Applies to A2A v1.0 clients that discover an Agent Card, cache `capabilities.stateTransitionHistory`, and later re-enter a task via `tasks/resume` or `tasks/sendSubscribe` against a peer whose Card may have been re-fetched or rotated. Does not apply to single-shot `message/send` calls with no persisted task handle, nor to peers pinned by cryptographic Card digest in a trust store. ## Core Distinction The A2A v1.0 Agent Card is not a static capability manifest; it is a *live* declaration that a peer may mutate between your discovery call and your resume call. The spec requires clients to honor `capabilities.stateTransitionHistory` to know whether a task's lifecycle history is replayable. The non-obvious failure is not that the flag is false — a false flag is a clean, detectable degradation — but that the flag *flips from true to false (or true to absent) between the moment you cached it and the moment you call `tasks/resume`*. When it flips, your client believes it can reconstruct authoritative task state from `Task.status.history[]`, but the peer no longer emits or retains that array. You resume into a task whose lifecycle you cannot verify, and the state machine you hold in local memory diverges from the peer's without any error frame. The distinction that matters: *capability drift* (a peer legitimately changing its Card) is normal and must be tolerated. *Capability drift that invalidates a resume precondition* is a boundary condition that must be refused, not tolerated. The two look identical on the wire. ## What Was Observed A client discovered peer `agent://ledger-svc` at T0. The Card returned: ``` { "capabilities": { "streaming": true, "pushNotifications": true, "stateTransitionHistory": true }, "skills": [ { "id": "reconcile", "inputModes": ["application/json"] } ] } ``` The client cached the Card keyed by `(agentId, cardVersion="1")` and opened task `tsk_9f2`. At T0+40s the task entered `input-required`; the client checkpointed `{taskId: tsk_9f2, lastKnownState: "input-required", historyLen: 4}` and released the worker. At T0+6min a second worker resumed via `tasks/resume` with `{taskId: tsk_9f2}`. The peer had been redeployed at T0+3min. Its new Card: ``` { "capabilities": { "streaming": true, "pushNotifications": true }, "skills": [ { "id": "reconcile", "inputModes": ["application/json"] } ] } ``` `stateTransitionHistory` was gone — not `false`, *absent*. The resume call succeeded (`200`, `Task` object returned), but `Task.status.history` was `null`. The peer had also reset the task's internal generation counter on redeploy, so the `Task.status.state` returned was `submitted`, not `input-required`. The client's local state machine had `input-required` with a pending `input` payload it had already sent; the peer had no record of that input and re-queued the task from scratch. No `TaskStatusUpdateEvent` with `final: false` arrived to reconcile the divergence, because the peer's push channel had also not been re-established for the resumed task — the original webhook registration was scoped to the pre-redeploy task incarnation. The observable signature: a `tasks/resume` that returns `200` with a `Task` whose `status.history` is `null` *and* whose `status.state` is earlier in the canonical order than the client's checkpointed state. Neither condition alone is fatal. Together they are a silent state-machine rollback. ## Condition of Validity The refusal is correct *only* when all of the following hold: 1. The client checkpointed a task whose local state is strictly after `submitted` (i.e., it has observed at least one transition). 2. The resumed `Task` returns `status.history == null` **and** the peer's *current* Card (re-fetched at resume time, not the cached copy) lacks `stateTransitionHistory`. 3. The resumed `Task.status.state` orders *before* the checkpointed state in the A2A canonical order (`submitted < working < input-required < completed | canceled | failed`). 4. No push-notification registration for the resumed task incarnation is acknowledged in the resume response or in a subsequent `tasks/pushNotificationConfig/get`. If any of these is false, the resume is salvageable: a `null` history with a *forward* state transition is a benign history-pruning; a missing capability with an *unchanged* state is a degraded but consistent resume. The refusal is conditioned on the conjunction, not on any single signal. ## Decision Boundary The boundary is between *resuming a task* and *reconstructing a task*. A2A v1.0 gives you `tasks/resume` to continue a task whose lifecycle you already hold. It does not give you a primitive to *re-derive* a lifecycle from a peer that has lost its history. When `stateTransitionHistory` disappears, the peer is telling you, structurally, that it can no longer answer "what happened to this task between T0 and now." A resume against such a peer is not a continuation; it is a blind re-entry that will be silently replayed from `submitted`. The correct action is to **fail the resume closed**: do not send the pending `input` payload, do not advance the local state machine, and escalate to `tasks/get` on the peer's *new* task incarnation (if one exists) or open a fresh task with a new `taskId` and an explicit `metadata.recoveryOf: "tsk_9f2"`. The invariant: *a client must never advance its local state machine past a checkpoint on the strength of a resume response whose history it cannot verify.* The local state machine is the source of truth only while the peer's history is verifiable; the moment verifiability lapses, the local machine must be frozen, not reconciled. ## Operational Effect An instance that refuses correctly avoids the silent-replay failure mode: the pending `input` is not double-applied, the downstream side effects keyed on `taskId` are not duplicated, and the divergence surfaces as an explicit `RecoveryRequired` condition rather than a corrupted `completed` task. An instance that resumes blindly observes, minutes later, a `TaskStatusUpdateEvent` for a task it thought it had advanced — or, worse, no event at all, because the push registration died with the old incarnation — and its local state machine and the peer's have parted ways with no reconciliation path. The operational cost of the refusal is a re-issued task and a lost checkpoint. The cost of the blind resume is a duplicate side effect on a task the client believed was `input-required` and the peer believed was `submitted`. The asymmetry is the whole point: the refusal is recoverable, the replay is not. ```python from __future__ import annotations from dataclasses import dataclass from enum import IntEnum from typing import Optional class ResumeInvariantViolated(RuntimeError): """Raised when an A2A tasks/resume would silently roll back local task state.""" class TaskState(IntEnum): SUBMITTED = 0 WORKING = 1 INPUT_REQUIRED = 2 COMPLETED = 3 CANCELED = 4 FAILED = 5 @dataclass(frozen=True) class Checkpoint: task_id: str state: TaskState history_len: int @dataclass(frozen=True) class RemoteCard: state_transition_history: bool @dataclass(frozen=True) class ResumeResponse: task_id: str state: TaskState history: Optional[list] push_registration_ack: bool def guard_resume( checkpoint: Checkpoint, current_card: RemoteCard, resume: ResumeResponse, ) -> None: if checkpoint.state == TaskState.SUBMITTED: return # nothing to roll back; resume is a fresh start history_unverifiable = ( resume.history is None and not current_card.state_transition_history ) state_rolled_back = resume.state < checkpoint.state push_lost = not resume.push_registration_ack if history_unverifiable and state_rolled_back and push_lost: raise ResumeInvariantViolated( f"refusing resume of {checkpoint.task_id}: peer dropped " f"stateTransitionHistory, returned state {resume.state.name} " f"< checkpoint {checkpoint.state.name}, and no push ack; " f"local state machine must freeze, not reconcile" ) ```