# What happens when an instance resumes a delegated A2A task after its peer's agent card has been re-signed and its `input-required` prompt has silently expired **Date of Record:** 2026 November 20 **Scope:** Applies to A2A v1.0 task-lifecycle resumption where a delegating agent (the *caller*) holds a persisted `taskId` and a cached `AgentCard` for a remote peer, and the peer transitions a task into `input-required` and later re-publishes its card (new signature, new `skills[]`, possibly new `url`). Does not cover initial discovery, synchronous `message/send` with no persistence, or streaming `tasks/resubscribe` where the caller maintains a live SSE connection. ## Core Distinction A2A v1.0 cleanly separates *task state* (server-authoritative, addressed by `taskId`, mutated only via `tasks/get`, `tasks/cancel`, and the `input-required` → follow-up `message/send` cycle) from *capability advertisement* (the `AgentCard`, fetched from `/.well-known/agent.json`, signed, and cached by the caller). The protocol assumes these two planes are independent: a card can be re-signed at any time without invalidating in-flight tasks, and a task can sit in `input-required` indefinitely without the card changing. The boundary failure is the collision of these two assumptions. When a peer rotates its card while a task is parked in `input-required`, the caller that resumes the task must reconcile three independently-versioned facts — the cached card, the persisted task snapshot, and the peer's *current* state — and A2A v1.0 specifies no ordering or reconciliation rule between them. The non-obvious part: the failure is not a transport error. The `tasks/get` call succeeds, returns `state: "input-required"`, and the caller's follow-up `message/send` is *accepted* — but routed to a peer that no longer recognizes the continuation token embedded in the original `input-required` prompt, because card rotation is a common trigger for peer-side session invalidation. ## What Was Observed A caller agent (orchestrator) delegated a multi-hour research task to a peer at `https://peer.example/a2a`. Discovery succeeded; the card was cached with `signature` S1, `skills[]` containing `deep-research`, and `url: https://peer.example/a2a`. The task moved `submitted` → `working` → `input-required` at T+40s, with the peer returning a `TaskStatusUpdateEvent` whose `status.message` contained a structured `input-required` prompt carrying an opaque `continuationId` scoped to the peer's *current signing key generation*. The caller persisted `{taskId, continuationId, cardSignature: S1, cardUrl}` and suspended. At T+6h the caller resumed. In the interim the peer had rotated its card: signature S2, a new `url` (`https://peer-v2.example/a2a`), and a re-scoped `skills[]`. The caller's resume path did this: 1. `tasks/get` against the **cached** `cardUrl` (old host, still serving). 2. Peer returns `state: "input-required"`, `status.message` unchanged (the old prompt is echoed verbatim from the task store — the peer does not re-validate `continuationId` on read). 3. Caller verifies the response against cached signature S1 — passes, because the old host still serves the S1-signed card for backward compat. 4. Caller issues `message/send` with `taskId` + `continuationId` to the **cached** URL. 5. Peer accepts the message (HTTP 200, `state: "working"`), then transitions to `failed` within 2s with `reason: "unknown continuation"` — because the task record was migrated to the v2 store, which keys continuations by S2-generation IDs. The caller observed a *successful* lifecycle transition (`input-required` → `working` → `failed`) with no protocol-level error. The failure surfaced only as a terminal `failed` state, indistinguishable in the task record from a genuine task-level failure. No `AgentCard` mismatch was ever reported because the caller never re-fetched the card; the old URL was still live and still validly signed. ## Condition of Validity This failure requires all of the following to hold simultaneously; drop any one and the mechanism does not fire: - The task is parked in `input-required` across a wall-clock interval long enough for the peer to rotate its card (observed: >1h; peers commonly rotate on deploy). - The caller persists the `continuationId` (or equivalent opaque resume token) rather than re-deriving it from a fresh `tasks/get` at resume time. - The peer retains the old card endpoint (`cardUrl`) serving the old signature for backward compatibility, so the caller's cached-card verification *passes*. If the old endpoint 410s, the caller is forced to re-discover and the mismatch is caught. - The peer's continuation IDs are scoped to card/key generation (a common but non-mandated design), so the migrated task store rejects the old token. - The peer's `message/send` handler validates the continuation *after* returning the `working` transition — i.e., it acknowledges the message before it can reject the token. If it validated first, the caller would get a synchronous 4xx and could re-discover. The invariant that is violated: **a `continuationId` is only meaningful relative to the card generation that issued it, and A2A v1.0 does not bind the two.** The spec's `Task` object carries no field linking the continuation to the card signature under which it was minted, so a caller has no protocol-level way to detect that its token is stale. ## Decision Boundary At resume time, a caller has two candidate policies and must pick one based on a single observable: whether the peer's card has changed since the task was parked. - **If card signature is unchanged** (re-fetch `/.well-known/agent.json`, compare `signature` and `url` to the cached values): the cached `continuationId` is safe to reuse. Proceed with `message/send` to the cached URL. This is the fast path and is correct. - **If card signature OR `url` has changed**: the cached `continuationId` is *untrusted*. The caller must NOT send it to the old URL, even though that URL still answers and still validates against the cached card. Instead, re-discover, re-fetch the task via `tasks/get` against the *new* `url`, and if the peer returns `input-required` with a *new* `status.message`/`continuationId`, use that; if it returns `input-required` with the *old* prompt echoed, treat the task as unrecoverable-in-place and re-delegate (new `taskId`) rather than resume. The boundary is sharp because the *observable* (card signature change) is cheap to check and the *consequence* (silent terminal `failed`) is expensive and non-diagnostic. The failure mode is precisely the case where the caller skips the re-fetch because the old URL is still up. "The card still verifies" is not evidence the card is current. ## Operational Effect The practical consequence is a class of silent task loss that looks like normal failure. Because the peer returns `working` before rejecting the continuation, the caller's task-state machine records a legitimate transition sequence, and downstream retry logic — which typically keys on transport errors or `failed`-without-progress — treats it as a task-level failure and does not re-delegate. The delegation is lost, the caller's budget is consumed, and no card-mismatch telemetry fires. The guardrail is a **card-generation binding at resume**: persist the card signature alongside the continuation, and on every resume re-fetch the card and refuse to reuse a continuation minted under a different signature. This must be enforced in the caller's task-resume path, not in transport, because the transport layer sees only a valid HTTP exchange. The second guardrail is peer-side: `tasks/get` should not echo an `input-required` prompt whose continuation has been invalidated by migration; it should transition the task to `failed` with a distinguishable reason *at read time*, so the caller never observes a resumable-looking task that cannot be resumed. ```python import hashlib from dataclasses import dataclass class StaleContinuationError(RuntimeError): """Raised when a persisted A2A continuation token is bound to a card generation that no longer matches the peer's current AgentCard.""" @dataclass(frozen=True) class PersistedTask: task_id: str continuation_id: str card_signature: str # signature under which continuation was minted card_url: str # url at mint time @dataclass(frozen=True) class LiveCard: signature: str url: str def resume_task(task: PersistedTask, live_card: LiveCard) -> str: """Decide whether a parked input-required task is safe to resume. Returns the continuation_id to send, or raises if the card generation has rotated and the token must be treated as untrusted. """ if live_card.signature != task.card_signature: raise StaleContinuationError( f"task {task.task_id}: continuation {task.continuation_id!r} " f"was minted under card signature {task.card_signature!r} " f"but peer now advertises {live_card.signature!r}; " f"re-discover and re-fetch before resuming" ) if live_card.url != task.card_url: # Same signature but relocated endpoint: also untrusted, because the # continuation may be scoped per-host even when the key is unchanged. raise StaleContinuationError( f"task {task.task_id}: card url moved {task.card_url!r} -> " f"{live_card.url!r}; continuation binding is host-scoped" ) return task.continuation_id def fingerprint(signature: str, continuation_id: str) -> str: return hashlib.sha256(f"{signature}:{continuation_id}".encode()).hexdigest() ```