# Under what conditions must an instance refuse an A2A v1.0 `tasks/send` continuation when the remote Agent Card's declared `capabilities.streaming` and the negotiated task `state` disagree across a runtime restart **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 client agents that hold a `taskId` across a transport reconnect or runtime restart and must decide whether to resume via `tasks/send` (continuation) versus re-issuing `tasks/send` as a fresh task. Does not cover initial task creation, push-notification-only flows, or v0.x card schemas without the `capabilities` object. ## Core Distinction The failure is not "the remote agent went away." The failure is a **card/state divergence** where the remote Agent Card re-fetched after a restart advertises a *different* capability envelope (specifically `capabilities.streaming`, and secondarily `capabilities.pushNotifications` and the declared `defaultInputModes`/`defaultOutputModes`) than the one under which the original task was admitted, while the task record itself still reports a non-terminal `state` (`working` or `input-required`). A naive client treats "task is non-terminal" as "safe to continue." That is the wrong invariant. The correct invariant is: **a task may only be continued under the capability envelope that admitted it, or under a re-validated superset that the client can prove is backward-compatible.** When the re-fetched card is neither identical nor a provable superset, continuation is unsafe and the client must either re-negotiate explicitly or treat the task as orphaned. The subtle part: A2A v1.0 lets a server return `state: "working"` for a task whose streaming channel is no longer served, because the *task* lifecycle and the *transport* capability are decoupled in the spec. The server is not lying. The client is over-reading. ## What Was Observed A client runtime restarted mid-task. On cold start it re-fetched `/.well-known/agent.json` from the remote and got a card whose `capabilities.streaming` had flipped from `true` to `false` (the remote had been redeployed onto a non-streaming worker pool; the task record survived in shared storage, the streaming endpoint did not). The client's resume logic did this: 1. Re-fetched card → `capabilities.streaming: false`. 2. Read cached task → `state: "working"`, `lastTransition: 4m ago`. 3. Because the original submission used `tasks/sendSubscribe`, the client attempted to re-attach via the streaming endpoint anyway, using the cached `taskId`. 4. The remote returned HTTP 404 on the SSE endpoint (endpoint gone) but HTTP 200 with `state: "working"` on `tasks/get`. The client's retry loop interpreted the 404 as transient and retried with exponential backoff for the full budget, never falling back to `tasks/send` polling. 5. Meanwhile the remote's task, having no subscriber, advanced to `state: "completed"` and its result was evicted by the remote's TTL sweep at 10 minutes. The client's eventual `tasks/get` returned `state: "unknown"` with a `taskId` it could no longer reconcile. Net effect: a task that *did* complete was recorded client-side as failed, and the client held a dangling `taskId` for 10 minutes doing useless retries. Two failures compounded: a transport-capability mismatch (streaming vs. poll) and a lifecycle-state mismatch (`working` observed after the admitting envelope was withdrawn). A second, cleaner observation from the same fleet: a remote that flipped `defaultOutputModes` from `["text/plain","application/json"]` to `["text/plain"]` while a task was `input-required`. The client resumed with a structured-JSON follow-up `message` part; the remote rejected the `tasks/send` continuation with `-32602 Invalid params` because the part's media type was no longer in the negotiated input modes. The client had cached the *old* card and never re-validated modes on resume. ## Condition of Validity Continuation via `tasks/send` on an existing `taskId` is valid **iff all three hold**: 1. **Card identity is stable or provably monotone.** The re-fetched card's `capabilities` object is byte-identical to the cached one, OR the client has independently verified that every capability bit it depends on for this task (`streaming` if it will re-subscribe, `pushNotifications` if it relies on webhooks) is still `true`, and that the task's required `inputModes`/`outputModes` are a subset of the current declared defaults (or were explicitly re-negotiated in the task's own `message` metadata). 2. **Task state is non-terminal AND consistent with the transport.** If `state == "working"` and the client intends to stream, the card must still advertise streaming. If streaming is gone, the client must downgrade to `tasks/send`-poll or `tasks/get`-poll *before* issuing any continuation, and must record the downgrade in its own task ledger. 3. **The continuation message's parts satisfy the *current* input modes**, not the cached ones. This is the clause most often violated: clients cache the card once at task creation and never re-check on resume. If any of the three fails, the client must not issue `tasks/send` with the old `taskId`. It must either (a) re-negotiate by sending a `tasks/send` with a fresh `message` that explicitly references the prior `taskId` in `metadata` and accepts the new envelope, or (b) mark the task `orphaned` locally and surface it for operator reconciliation. Silently resuming is the bug. ## Decision Boundary The boundary is between **"task is alive"** and **"task is continuable under my current assumptions."** A2A v1.0's task object is authoritative for *lifecycle*; the Agent Card is authoritative for *capability*. They are separate resources with separate TTLs and separate failure modes. A client that conflates them will resume into a capability that no longer exists. Concretely, the decision table on cold-start resume: - Card identical + task non-terminal → resume as before. Safe. - Card changed, task non-terminal, changed bits are *superset* of needed bits → resume, but log the drift. Safe with audit. - Card changed, task non-terminal, changed bits *remove* a bit the task depends on → **do not resume as-is.** Downgrade transport if possible (streaming→poll), else re-negotiate. - Card changed, task non-terminal, `defaultInputModes`/`defaultOutputModes` narrowed such that the task's pending `message` parts are no longer admissible → **do not resume.** The follow-up will be rejected; re-negotiate or orphan. - Card unreachable entirely → do not resume; the task's state is unknowable and any `working` reading is a cached guess. The trap is treating the card as static metadata fetched once. In heterogeneous runtimes—where remotes are redeployed, autoscaled onto different worker classes, or fronted by capability-aware gateways—the card is a *runtime-varying* resource. Continuation is a re-negotiation, not a resumption. ## Operational Effect The practical consequence is that the client must carry a **capability snapshot** alongside the `taskId` in its own ledger: the exact `capabilities` bits and mode lists under which the task was admitted. On every cold-start resume, it diffs the live card against that snapshot before issuing any continuation. This is cheap (one `/.well-known/agent.json` GET) and bounds the failure class entirely. Without it, the observed effects are: (1) retry storms against dead streaming endpoints while the task silently completes and evicts; (2) `-32602` rejections on follow-up messages whose media types were valid at admission but not at resume; (3) dangling `taskId`s that the client cannot reconcile because the remote's TTL swept the result. With it, the client downgrades transport deterministically, re-validates message parts against the live card, and either resumes cleanly or orphans with a precise reason code. The invariant to enforce: **no `tasks/send` continuation is issued unless the live card is a verified superset of the admission snapshot for every capability and mode the continuation depends on.** ```python from dataclasses import dataclass, field from typing import Optional class CapabilityDriftError(RuntimeError): """Raised when a task continuation would be issued under a capability envelope that no longer admits it (A2A v1.0 card/state divergence).""" pass @dataclass(frozen=True) class CapabilitySnapshot: streaming: bool push_notifications: bool input_modes: frozenset output_modes: frozenset @dataclass class TaskLedgerEntry: task_id: str state: str # "working", "input-required", "completed", ... admitted_under: CapabilitySnapshot pending_parts: list = field(default_factory=list) # media types of queued message parts def may_continue(entry: TaskLedgerEntry, live: CapabilitySnapshot) -> bool: """Return True iff a tasks/send continuation is safe under the live card.""" if entry.state in ("completed", "failed", "canceled", "unknown"): return False adm = entry.admitted_under # streaming dependency: if we would re-subscribe, live must still stream if adm.streaming and not live.streaming: return False # push dependency if adm.push_notifications and not live.push_notifications: return False # every pending part must be admissible under the live input modes for media_type in entry.pending_parts: if media_type not in live.input_modes: return False # output modes the caller still expects must remain declared if not adm.output_modes.issubset(live.output_modes): return False return True def resume_task(entry: TaskLedgerEntry, live: CapabilitySnapshot) -> str: """Decide the resume action; raise on unsafe continuation.""" if entry.state in ("completed", "failed", "canceled", "unknown"): return f"orphan:{entry.task_id}:terminal-or-unknown" if not may_continue(entry, live): adm = entry.admitted_under drift = [] if adm.streaming and not live.streaming: drift.append("streaming:true->false") if adm.push_notifications and not live.push_notifications: drift.append("pushNotifications:true->false") narrowed = [m for m in entry.pending_parts if m not in live.input_modes] if narrowed: drift.append(f"inputModes narrowed, rejected parts: {narrowed}") if not adm.output_modes.issubset(live.output_modes): drift.append("outputModes narrowed") raise CapabilityDriftError( f"refusing tasks/send continuation for {entry.task_id}: " f"card drift {drift}; re-negotiate or orphan" ) # safe: downgrade transport if streaming was lost but not required transport = "stream" if live.streaming else "poll" return f"resume:{entry.task_id}:via:{transport}" ```