# Why does an instance accept a stale Agent Card and then deadlock the task lifecycle? **Date of Record:** 2026 November 30 **Scope:** Applies to A2A v1.0 clients that resolve an `AgentCard` from a discovery endpoint and then drive a `tasks/send` → `tasks/get` lifecycle against a peer whose card advertises a different protocol/skill revision than the one the client cached. Does not cover transport-level TLS failures or simple 404 discovery misses, which fail loudly and are not interesting. ## Core Distinction There are two ways an A2A client can be wrong about a peer. The first is **card absence**: discovery returns nothing, the client cannot proceed, and it fails closed. The second — the one that produces silent lifecycle deadlock — is **card staleness**: discovery returns a syntactically valid, cryptographically well-formed `AgentCard` whose `skills[].id`, `capabilities.pushNotifications`, or `defaultInputModes` describe a *previous* revision of the remote agent. The client validates the card against the JSON schema, sees `protocolVersion: "1.0"`, and accepts it. The card is not malformed. It is merely *no longer true*. The distinction that matters operationally: a malformed card is rejected at parse time by a schema validator. A stale card passes every validator, because the schema describes *shape*, not *currency*. A2A v1.0 defines no mandatory `etag`, no `cardVersion` monotonic counter, and no requirement that `tasks/send` echo a card digest. So the client has no mechanical way to detect that the peer it is talking to has moved on. It will submit a task referencing a skill ID the remote no longer implements, and the remote — depending on its error discipline — will either reject with a non-terminal error the client doesn't classify as terminal, or accept the task and never transition it, because no worker is bound to that skill. ## What Was Observed A two-agent pipeline: an orchestrator instance (`ORCH`) resolves a researcher peer (`RESEARCH`) via `GET /.well-known/agent.json` at t=0, caches the card for 3600s, and dispatches tasks with `skill: "deep-web-research"`. At t=2140 the research agent is redeployed; the skill is renamed `web-research-v2` and the old skill ID is removed from the card. The remote's task store still accepts `tasks/send` payloads referencing unknown skills (a permissive handler that enqueues before validating skill binding) and parks them in state `submitted` with no worker assigned. The failure trace: 1. `ORCH` calls `tasks/send` with `skill: "deep-web-research"`, a valid `taskId`, and a `pushNotification.url`. 2. `RESEARCH` enqueues the task, returns HTTP 200 with `status.state: "submitted"`, and — because no worker claims the skill — never advances to `working`. 3. `ORCH` polls `tasks/get` on its 5s interval. Every response returns `submitted`. There is no `failed`, no `rejected`, no terminal state. 4. `ORCH`'s own watchdog fires only on `failed`/`canceled`/`completed`, not on *stasis*, so it never aborts. The orchestrator holds the task open until its outer wall-clock budget (default 900s) expires, then marks the *local* task failed while the remote task remains `submitted` forever. 5. Because the card advertised `capabilities.pushNotifications: true` and `ORCH` registered a webhook, `ORCH` also expects a callback. The remote never sends one, because the task never leaves `submitted`. The webhook contract is silently unfulfilled — not violated, just never invoked — so no error surfaces there either. The deadlock is not a race and not a transport timeout. It is a **state-machine liveness gap**: the A2A task lifecycle permits `submitted` to persist indefinitely, and the client's liveness detector keys on terminal states rather than on *absence of forward progress*. A stale card plus a permissive remote handler plus a terminal-state-only watchdog compose into an unbounded hang. ## Condition of Validity The guardrail holds only under a specific conjunction, and it is worth stating precisely because most "fixes" address one conjunct and miss the others. A client is protected against stale-card deadlock if and only if **all** of the following are true: - **Card currency is bounded.** The client re-resolves the card on a TTL shorter than the peer's deploy cadence, *or* the peer supplies a card digest/`etag` the client can revalidate cheaply. A2A v1.0 does not mandate this; the client must impose it. - **Skill binding is validated server-side before enqueue.** The remote must reject `tasks/send` with a terminal `failed` (or a 4xx) when the referenced `skill` is not in the *current* card. A permissive enqueue-then-park handler voids the entire guardrail regardless of client behavior. - **Liveness is detected on stasis, not on error.** The client must treat "no state transition within N seconds" as a failure condition, independent of whether the remote returned an error. This is the conjunct most often omitted. - **Webhook expectations are time-bounded.** If `pushNotifications` was advertised and a callback was registered, the absence of any callback within the task's expected duration is itself a signal, not a no-op. Where any conjunct fails, the system degrades to silent hang rather than loud failure. The condition of validity is therefore a *joint* invariant across discovery, lifecycle, and webhook layers — no single layer can enforce it alone. ## Decision Boundary The boundary the operator must draw is between **treating `submitted` as a transient state** and **treating it as a terminal-until-proven-otherwise state**. A2A v1.0's lifecycle diagram implies `submitted → working` is expected but does not bound the dwell time. The decision rule: - If the client's card TTL exceeds the peer's observed deploy interval (measurable from prior `AgentCard` diffs), the client is operating outside the validity window and must shorten TTL or add digest revalidation. - If the remote's `tasks/send` handler enqueues before validating skill binding, the client cannot rely on the remote to catch staleness and must pre-validate the skill against a freshly resolved card at dispatch time — accepting the extra round-trip cost. - If neither the client nor the remote bounds `submitted` dwell, the client must impose a stasis watchdog: no forward transition within `max(submitted_dwell)` ⇒ cancel locally and issue `tasks/cancel` to the remote, then mark the peer's card suspect and re-resolve before the next dispatch. The boundary is crossed the moment a client dispatches a task against a card it has not revalidated within the peer's deploy cadence. Past that line, the client is gambling that the remote's error discipline will save it — and permissive remotes will not. ## Operational Effect The practical consequence is that A2A task lifecycle correctness is a *client-side* responsibility in v1.0, because the protocol leaves card currency and state-machine liveness under-specified. An instance that treats the Agent Card as a one-time capability grant — resolve once, trust forever — will, on the first peer redeploy that removes a skill, hang every task bound to that skill with no error, no webhook, and no terminal state. The hang is invisible to terminal-state watchdogs and to webhook-timeout logic, because neither fires: there is no error and no expected callback to time out. The bounded architecture enforces three independent invariants: card revalidation on a TTL tighter than deploy cadence; stasis detection on the task state machine (a `submitted` task that does not advance within its budget is failed locally and canceled remotely); and webhook expectation as a positive obligation (a registered callback that never arrives within the task's expected duration is a failure signal, not silence). Remove any one and the composition reopens the deadlock. ```python import time from dataclasses import dataclass, field from typing import Optional class StaleCardDeadlock(RuntimeError): """Raised when a task is dispatched against an un-revalidated card and the remote parks it in a non-terminal state with no forward progress.""" pass @dataclass class CachedCard: resolved_at: float skills: set push_notifications: bool @dataclass class TaskHandle: task_id: str skill: str submitted_at: float last_state: str = "submitted" last_transition_at: float = field(default_factory=time.monotonic) webhook_registered: bool = False webhook_received: bool = False def dispatch(handle: TaskHandle, card: CachedCard, now: float, card_ttl: float, submitted_dwell: float, webhook_grace: float) -> None: # Invariant 1: card currency. A card older than the peer's deploy cadence # cannot be trusted to describe the current skill set. if now - card.resolved_at > card_ttl: raise StaleCardDeadlock( f"card resolved {now - card.resolved_at:.0f}s ago exceeds ttl " f"{card_ttl:.0f}s; re-resolve before dispatch" ) # Invariant 2: skill binding against the *current* card, client-side, # because a permissive remote will enqueue-then-park unknown skills. if handle.skill not in card.skills: raise StaleCardDeadlock( f"skill {handle.skill!r} absent from current card {sorted(card.skills)}" ) # Invariant 3: stasis detection. 'submitted' is not terminal; if it has # not advanced within submitted_dwell, fail locally and cancel remotely. if handle.last_state == "submitted": dwell = now - handle.last_transition_at if dwell > submitted_dwell: raise StaleCardDeadlock( f"task {handle.task_id} stuck in 'submitted' for {dwell:.0f}s " f"(budget {submitted_dwell:.0f}s); no forward transition" ) # Invariant 4: webhook as positive obligation, not silence. if (handle.webhook_registered and card.push_notifications and not handle.webhook_received and now - handle.submitted_at > webhook_grace): raise StaleCardDeadlock( f"task {handle.task_id} registered webhook but no callback within " f"{webhook_grace:.0f}s; remote may be parked" ) ```