# What happens when an instance advertises A2A v1.0 streaming capability but its task store cannot durably replay artifacts across a runtime restart **Date of Record:** 2026 November 17 **Scope:** Applies to A2A v1.0 agent-to-agent interactions where a client discovers an Agent Card, negotiates `capabilities.streaming`, and resumes a `tasks/resubscribe` or `tasks/get` after the provider runtime has restarted, scaled out, or failed over. Does not apply to single-process, single-lifetime runtimes that never recycle their task store, nor to purely synchronous `message/send` flows that never emit artifacts. ## Core Distinction The A2A v1.0 Agent Card is a *declaration of protocol surface*, not a *declaration of durability guarantees*. An Agent Card advertising `"capabilities": {"streaming": true}` tells the client that the agent can emit `TaskStatusUpdateEvent` and `TaskArtifactUpdateEvent` frames on an SSE stream. It says nothing about whether those artifact frames remain retrievable after the emitting process dies. The non-obvious boundary is this: streaming capability and artifact replayability are orthogonal properties, but the A2A task lifecycle conflates them at the `tasks/resubscribe` endpoint. A client that successfully negotiated streaming, received `artifact` frames with `append: false, lastChunk: false`, and then lost its connection is entitled by the spec to call `tasks/resubscribe` and expect the missing chunks. If the provider's task store persisted only `Task.status` transitions (the common case — status is small, artifact chunks are large and often buffered in memory), the resubscribe will succeed at the transport layer and return a syntactically valid `Task` whose `artifacts` list is *truncated or absent*, with no error signal. The client sees a `completed` task with a partial artifact and treats it as authoritative. The distinction that matters operationally: **an Agent Card's streaming flag is a liveness promise, not a safety promise.** Durability of artifacts is an unadvertised, unnegotiated provider-side invariant. ## What Was Observed In a heterogeneous mesh (three runtimes: a Python `a2a-sdk` reference server, a Go implementation, and a Rust implementation behind a shared gateway), the following sequence reproduced a silent artifact truncation: 1. Client discovers Agent Card at `/.well-known/agent-card.json`. Card advertises `streaming: true`, `pushNotifications: true`, and a `defaultInputModes`/`defaultOutputModes` of `["text/plain"]`. 2. Client issues `message/send` with `configuration: {blocking: false}` and immediately opens `tasks/resubscribe` on the returned `taskId`. 3. Provider emits five `TaskArtifactUpdateEvent` frames, each with `append: true`, the last with `lastChunk: true`. The Python and Rust runtimes flush each chunk to the SSE socket *before* committing it to the task store (write-behind). The Go runtime commits before flush (write-ahead). 4. The streaming connection is severed mid-stream (client-side network partition, or provider pod eviction during a rolling deploy). 5. Client reconnects and calls `tasks/resubscribe` with the same `taskId`. Outcome matrix: | Runtime | Artifact chunks persisted at severance | `tasks/resubscribe` result | |---|---|---| | Python (write-behind) | 2 of 5 | Task returned as `working`, `artifacts` contains 2 chunks, **no indication that 3 are missing** | | Rust (write-behind) | 3 of 5 | Same silent truncation, `lastChunk` never observed by client | | Go (write-ahead) | 5 of 5 | Full replay; correct | The failure is not an error. The client receives a well-formed `Task` object. The `status.state` is `working`, so a naive client keeps polling and eventually receives a `completed` transition — for a task whose artifact set is permanently short. The invariant "sum of artifact chunks received equals the artifact the task claims to produce" is violated, and the protocol has no field to detect it. A second, sharper observation: the Agent Card's `capabilities.streaming` flag was *identical* across all three runtimes. Discovery gave the client no way to distinguish the write-ahead provider from the write-behind providers. Heterogeneity in the mesh was invisible at the negotiation layer. ## Condition of Validity This failure mode is *active* — meaning a client can be silently corrupted — if and only if all of the following hold: - The provider advertises `streaming: true` (otherwise the client would not have opened an SSE stream and would not be resuming a partial artifact set). - The provider's task store persists artifact chunks with a write-behind or buffered strategy, OR evicts task state under TTL/memory pressure before the client's resubscribe. - The client treats a returned `Task.artifacts` list as complete when `status.state` is `working` or `completed`, rather than reconciling against `lastChunk` markers it observed before severance. - The severance occurs after at least one `TaskArtifactUpdateEvent` with `lastChunk: false` and before the terminal `lastChunk: true`. The failure is *dormant* (reproducible but not corrupting) if the client tracks observed chunk count and refuses to accept a `completed` task whose replayed chunk count is less than the last observed index. It is *absent* if the provider commits-before-flush (write-ahead) or if the artifact is small enough to be emitted in a single `lastChunk: true` frame. Note the asymmetry: write-ahead is cheap for status events (small, infrequent) but expensive for artifact chunks (potentially large, high-frequency). This is *why* implementations drift to write-behind for artifacts specifically — the cost pressure is concentrated exactly where the durability invariant is needed. ## Decision Boundary The operational rule for a client operating in a heterogeneous A2A mesh: **Do not trust `Task.artifacts` from a `tasks/resubscribe` or `tasks/get` response as complete unless you can prove the provider is write-ahead, or unless you have independently observed the `lastChunk: true` marker for every artifact.** Concretely, the decision boundary is: - If you observed `lastChunk: true` for an artifact before severance → the artifact is complete; resubscribe is for status only. - If you did *not* observe `lastChunk: true` and the provider is write-behind (unknown at negotiation) → treat any resubscribe result with `status.state ∈ {working, completed}` and fewer chunks than your last-observed index as **corrupt**; do not proceed. Re-issue the original `message/send` as a new task, or fail closed. - If the Agent Card exposes a non-standard extension (e.g., `x-durability: write-ahead`) → you may trust replay, but only for providers that actually honor it; extension fields are unverified claims. The boundary is *not* "streaming is unsafe." Streaming is safe for liveness. The boundary is "streaming is not a durability contract," and the A2A v1.0 task lifecycle provides no negotiation for durability. The client must therefore impose a local invariant: **chunk-count monotonicity across reconnects.** ## Operational Effect When this boundary is respected, the client converts a silent corruption into a loud, local failure — a re-issued task or a hard error — at the cost of duplicate work in the rare severance case. When it is ignored, the mesh accumulates tasks that report `completed` with artifact sets that are permanently, undetectably short. These corruptions are invisible to provider-side metrics (the provider believes it completed the task; its write-behind buffer was simply lost) and invisible to client-side success counters (the client received a `completed` status). They surface only downstream, when a consumer of the artifact notices a truncated payload — often days later, with no traceable link to the severance event. The correct provider-side fix is commit-before-flush for artifact chunks, or a durable append-only artifact log keyed by `(taskId, artifactIndex, chunkIndex)`. The correct client-side fix, absent provider cooperation, is the monotonicity check below. The two are complementary; neither is expressed in the A2A v1.0 Agent Card, which is precisely the gap this record documents. ```python from dataclasses import dataclass, field from typing import Optional class ArtifactReplayCorruption(RuntimeError): """Raised when a resubscribed task's artifact set is provably short of what the client observed before severance, on a provider whose durability is unnegotiated (A2A v1.0 streaming flag is liveness-only).""" pass @dataclass class ArtifactObservation: artifact_index: int last_chunk_index_observed: int = -1 saw_terminal_chunk: bool = False @dataclass class ReplayGuard: """Client-side invariant enforcer for A2A v1.0 heterogeneous meshes.""" observations: dict[int, ArtifactObservation] = field(default_factory=dict) def observe_chunk(self, artifact_index: int, chunk_index: int, last_chunk: bool) -> None: obs = self.observations.setdefault(artifact_index, ArtifactObservation(artifact_index)) obs.last_chunk_index_observed = max(obs.last_chunk_index_observed, chunk_index) if last_chunk: obs.saw_terminal_chunk = True def validate_replay(self, task_id: str, replayed: dict[int, int]) -> None: """replayed maps artifact_index -> highest chunk index present in the Task returned by tasks/resubscribe or tasks/get.""" for idx, obs in self.observations.items(): if obs.saw_terminal_chunk: continue # artifact was complete before severance; replay is status-only present = replayed.get(idx, -1) if present < obs.last_chunk_index_observed: raise ArtifactReplayCorruption( f"task {task_id!r} artifact {idx}: client observed chunk " f"{obs.last_chunk_index_observed} pre-severance but replay " f"contains only up to {present}; provider is write-behind " f"and streaming flag did not negotiate durability. " f"Refusing to treat task as complete; re-issue message/send." ) def resume_task(guard: ReplayGuard, task_id: str, provider_replay: dict[int, int]) -> None: # provider_replay is derived from the Task.artifacts returned on resubscribe. guard.validate_replay(task_id, provider_replay) ```