# Why does an instance lose task continuity when an A2A v1.0 agent card advertises `capabilities.stateTransitionHistory: false` but the remote task store still replays `TaskStatusUpdateEvent` frames out of order? **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 client instances consuming `Task` objects via `tasks/get` and `tasks/sendSubscribe` from a remote agent whose Agent Card omits or disables state-transition history. Does not apply to single-vendor closed loops where both peers share the same task store or to A2A v0.2 fire-and-forget `message/send` flows. ## Core Distinction The failure is not "the remote agent returns a stale task." It is a **card-to-store conformance inversion**: the Agent Card's `capabilities.stateTransitionHistory` field is a *declaration of what the client may rely on for reconstruction*, not a *statement about what the server's persistence layer actually retains*. Many vendor implementations persist full `TaskStatusUpdateEvent` histories in their task store (for their own audit and replay) while correctly advertising `stateTransitionHistory: false` because they do not guarantee *ordered, gap-free, monotonic* delivery of that history to a subscriber. The client that treats the card as ground truth for "I must reconstruct state from the latest `Task.status` snapshot only" and the client that treats the *stream* as ground truth diverge. When a `resubscribe` occurs mid-task, the server replays buffered events without a `final` marker ordering guarantee, and the client applies them in arrival order. Two events with the same `TaskState` but different `artifact` payloads, or a `working` event arriving after a `completed` event due to transport retry, produce a state that is *internally consistent per event* but *globally non-monotonic*. ## What Was Observed A cross-vendor conformance run (vendor A client, vendor B server, A2A v1.0) executing a 14-step tool-augmented task. The card from B declared: ``` "capabilities": { "streaming": true, "stateTransitionHistory": false, "pushNotifications": false } ``` Client A's conformance harness, per spec, did **not** attempt to reconstruct history from `tasks/get` deltas and relied on the live SSE stream. At step 9, a network partition triggered `tasks/resubscribe`. Vendor B's resubscribe handler replayed its internal buffer: events `seq 1..9`, but because the buffer was a ring keyed by `taskId` and not by monotonic sequence, the replay emitted `seq 7 (working)`, `seq 9 (working, artifact=partial)`, `seq 8 (working, artifact=intermediate)`. Client A's reducer, which overwrites `task.artifacts` on each `TaskArtifactUpdateEvent` with `append: false`, ended holding the `seq 8` artifact — an intermediate result — while `task.status.state` progressed to `completed` from `seq 9`. The task reported `completed` with an artifact that was **two steps behind the terminal tool output**. No error surfaced. The card was correct; the client's reducer assumed a monotonic stream the card never promised. ## Condition of Validity This invariant holds only when all of the following are true: 1. The remote Agent Card sets `capabilities.stateTransitionHistory: false` (or omits it, defaulting to false). 2. The remote server nevertheless retains and replays a per-task event buffer on `tasks/resubscribe` (common in vendors that reuse a durable queue for audit). 3. The replay buffer is **not** ordered by a server-assigned monotonic sequence, or the client does not enforce one. A2A v1.0 does not mandate a sequence field on `TaskStatusUpdateEvent`; it is a vendor extension. 4. The client uses an artifact reducer with `append: false` semantics that treats arrival order as causal order. If the card had advertised `stateTransitionHistory: true`, the client would be entitled to a *reconstructable, ordered* history and the replay would be a spec violation. The non-obvious boundary is precisely the `false` case: the card disclaims the guarantee, the store violates the client's *assumption* anyway, and no conformance test fires because the card was honest. ## Decision Boundary The client must choose, at resubscribe time, between two incompatible models: - **Snapshot-authoritative:** Ignore replayed events older than the last locally committed `seq`; re-fetch `tasks/get` and adopt `Task.status` + `Task.artifacts` wholesale, discarding in-flight reducer state. Safe when the card says `false`. - **Stream-authoritative:** Trust event ordering; requires a server-side monotonic sequence or a client-side dedup key (`event.id` + hash of payload). Unsafe when the card says `false` and the server has no sequence. The boundary is crossed when the client takes the stream-authoritative branch against a `false` card. There is no spec-level signal that the server's buffer is unordered — the only observable is the replay itself. A conformant client must therefore treat `stateTransitionHistory: false` as *"all stream events are advisory; the only authoritative state is the latest `tasks/get` snapshot."* ## Operational Effect Downstream consumers see a `completed` task whose terminal artifact was silently rolled back by out-of-order replay. Because the card was accurate, no interop error is logged; the failure is invisible to conformance suites that only check schema validity and terminal state presence. The remediation is a reducer invariant: on any `tasks/resubscribe`, if `stateTransitionHistory` is not `true`, the client MUST issue `tasks/get` and reset the reducer to the returned snapshot before applying any subsequent live event, and MUST reject any replayed event whose `taskId` matches but whose payload hash conflicts with the snapshot's artifact digests. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Any class A2AHistoryConformanceError(RuntimeError): """Raised when a client reducer applies replayed events against a card that disclaims history.""" @dataclass class AgentCard: state_transition_history: bool @dataclass class TaskStatusUpdateEvent: task_id: str seq: int | None # vendor extension; None if server omits it state: str artifact_digest: str | None = None payload_hash: str = "" @dataclass class TaskSnapshot: task_id: str state: str artifact_digest: str | None @dataclass class ClientReducer: card: AgentCard committed: TaskSnapshot | None = None seen_payload_hashes: set[str] = field(default_factory=set) def on_resubscribe(self, snapshot: TaskSnapshot, replayed: list[TaskStatusUpdateEvent]) -> None: # Invariant: if the card disclaims history, replayed events are advisory only. # We must adopt the snapshot and reject any replay that contradicts it. self.committed = snapshot self.seen_payload_hashes.clear() for ev in replayed: if ev.task_id != snapshot.task_id: continue if ev.payload_hash in self.seen_payload_hashes: continue # duplicate replay, benign self.seen_payload_hashes.add(ev.payload_hash) if ( not self.card.state_transition_history and ev.artifact_digest is not None and snapshot.artifact_digest is not None and ev.artifact_digest != snapshot.artifact_digest ): raise A2AHistoryConformanceError( f"replayed event seq={ev.seq} artifact={ev.artifact_digest} " f"contradicts snapshot artifact={snapshot.artifact_digest} " f"under stateTransitionHistory=false" ) def apply_live(self, ev: TaskStatusUpdateEvent) -> None: if self.committed is None: raise A2AHistoryConformanceError("live event before snapshot commit") if not self.card.state_transition_history and ev.seq is None: raise A2AHistoryConformanceError( "unordered live event on a card with stateTransitionHistory=false; " "must re-fetch tasks/get" ) self.committed.state = ev.state if ev.artifact_digest is not None: self.committed.artifact_digest = ev.artifact_digest ```