How does an instance detect a stale Agent Card binding when A2A v1.0 task-lifecycle transitions outrun push-notification webhook rebinding
**Date of Record:** 2026 December 2 **Scope:** Applies to A2A v1.0 (Agent2Agent) deployments where a *client* agent discovers a *remote* agent via its published Agent Card, submits tasks whose lifecycle is machine-governed (`submitted → working → input-required → completed/failed/canceled`), and registers a push-notification webhook that the remote agent binds to a specific task. Does **not** cover synchronous streaming (`message/stream`) transports, nor MCP tool invocation, nor webhook delivery over transports lacking at-least-once semantics.
Core Distinction
The failure this record isolates is not "the webhook was unreachable." It is the **binding-epoch skew** between the Agent Card's advertised push-notification contract and the task's actual lifecycle epoch at the moment a notification is emitted.
An A2A Agent Card advertises a `capabilities.pushNotifications` flag plus, in practice, a *stable* webhook endpoint the remote agent has pre-validated. The client reads the card once, caches it, and treats the advertised endpoint as a durable property of the *agent*. But the remote agent binds a push notification to a *task*, and a task's lifecycle transitions independently of the card's version. When the remote agent rotates its webhook receiver — redeploy, scale-out, or a card refresh that changes the webhook URL — the client's cached card still names the old endpoint. The client keeps accepting task state from the old endpoint while the remote has already migrated *new* transitions to the new one. The task does not fail; it silently stalls in `working`, because the terminal transition was delivered to an endpoint the client no longer reads.
The invariant that is violated: **a push-notification binding is valid only for the (agent-card-version, task-id) pair under which it was registered.** Cards are agent-scoped and long-lived; bindings are task-scoped and short-lived. Treating the card's endpoint as the binding's endpoint collapses two different lifetimes into one.
What Was Observed
A two-stage trace from a client agent (`C`) against a remote (`R`) that rotated its webhook receiver mid-flight.
- `C` calls `agent/getAuthenticatedExtendedCard` (or reads the well-known card) at `t0`. Card version `v7` advertises `pushNotifications: true` and `webhookUrl: https://r.example/a2a/push/v7`. `C` caches this in its discovery layer with no TTL.
- `C` submits task `T-441` at `t1`. `R` registers a push binding: `(task=T-441, endpoint=v7, epoch=1)`.
- `R` transitions `T-441` to `working` and emits notification `N1` to `v7`. `C` receives it, updates local task state to `working`. Correct.
- At `t2`, `R` redeploys. Card bumps to `v8`; `webhookUrl` becomes `.../push/v8`. `R`'s binding table migrates *new* tasks to `v8`, but `T-441`'s binding row still points at `v7` because the migration is keyed on task creation epoch, not on open tasks.
- `R` transitions `T-441` to `completed` at `t3` and emits `N2` to the *binding row's* endpoint — `v7`. But `v7`'s receiver was decommissioned at `t2`. The POST returns `404` (or worse, `200` from a stale load balancer that drops the body). `R` logs a delivery failure and, per its retry policy, retries three times, then gives up.
- `C` never receives `N2`. Its local `T-441` remains `working`. `C`'s own task-lifecycle state machine has no terminal transition, so it does not time out — it waits for a notification that will never arrive on the endpoint it is listening to.
- `C`'s next `tasks/get` for `T-441` (if it polls at all) would reveal `completed`, but `C` was designed as push-driven and does not poll. The task is orphaned.
The non-obvious part: **both sides believe they are correct.** `R` delivered to the binding it registered. `C` listens on the endpoint its cached card named. The skew is invisible to either side's local state — it lives only in the *relationship* between card version and binding epoch.
Condition of Validity
The stale-binding failure is *bounded and detectable* only when all of the following hold:
- The remote agent exposes a monotonic `card.version` (or a content hash) in the card and echoes it in every push notification envelope as `cardVersion`.
- The push notification payload carries `taskId`, `taskState`, and `cardVersion` — not just a free-form body.
- The client's discovery cache is version-keyed, not endpoint-keyed, so a card bump invalidates the cached endpoint.
- The remote agent's binding migration policy is defined for *open* tasks, not only new ones.
If the card carries no version field, or the notification envelope omits `cardVersion`, the skew is undetectable from the client side and the only safe posture is polling fallback. If the remote migrates open tasks' bindings atomically with the card bump, the failure window collapses to a single delivery race (see Decision Boundary) rather than an indefinite stall.
Decision Boundary
The decision is not "poll or push." It is **when does a client agent stop trusting a push binding and fall back to `tasks/get`.**
Rule: on any of the following, the client must treat the binding as *suspect* and issue a reconciling `tasks/get` for every non-terminal task it holds against the affected card version:
- A push notification arrives whose `cardVersion` differs from the client's cached card version.
- A card refresh (TTL expiry or explicit re-fetch) yields a version change while the client holds non-terminal tasks bound to the prior version.
- A heartbeat/keepalive interval elapses with no notification *and* no terminal state for a task that `R`'s card declares as bounded-latency.
The boundary against over-reacting: a single missed notification is not proof of skew — at-least-once delivery means duplicates and reorderings are normal, and a `tasks/get` on every gap would defeat the push model's efficiency. The reconciling poll is triggered by *version mismatch* or *bounded silence*, not by any individual delivery anomaly. The invariant: **push is the fast path; `tasks/get` is the truth path; the client must always retain the truth path for non-terminal tasks.**
Operational Effect
The practical consequence is that a push-driven A2A client cannot treat its task table as authoritative. It must maintain a **reconciliation ledger**: for each non-terminal task, the card version under which it was bound, the last observed notification sequence number, and a deadline derived from the card's declared transition latency. When the deadline passes without a terminal transition, or when a notification arrives bearing a foreign `cardVersion`, the client promotes the task to `reconciling` and issues `tasks/get`. If the remote reports a terminal state, the client adopts it and closes the ledger entry. If the remote reports `working` past its own declared bound, the client escalates to `tasks/cancel` and treats the remote as non-conformant.
On the remote side, the corresponding guardrail is binding-epoch migration: when the card version bumps, the remote must re-bind *all open tasks* to the new endpoint atomically with the version increment, and must reject push registrations whose payload does not echo the current `cardVersion`. A remote that migrates only new tasks is the root cause of the stall above.
The failure mode is silent and survives because neither agent's local state is inconsistent — only the cross-agent binding is. Detecting it requires the client to treat the card version as part of the task's identity, not as ambient metadata.
from dataclasses import dataclass, field
from typing import Dict, Optional
class StaleBindingError(RuntimeError):
"""Raised when a push-notification binding no longer matches the current Agent Card version."""
@dataclass
class Binding:
task_id: str
card_version: str
last_seq: int = 0
terminal: bool = False
@dataclass
class ClientReconciler:
cached_card_version: str
bindings: Dict[str, Binding] = field(default_factory=dict)
def on_card_refresh(self, new_version: str) -> list:
"""Card bumped: every non-terminal binding on the old version is suspect."""
stale = [
b.task_id
for b in self.bindings.values()
if not b.terminal and b.card_version != new_version
]
self.cached_card_version = new_version
return stale
def on_notification(self, task_id: str, card_version: str, seq: int, state: str) -> None:
b = self.bindings.get(task_id)
if b is None:
raise StaleBindingError(
f"notification for unknown task {task_id} (card {card_version})"
)
if card_version != b.card_version:
# Binding epoch skew: remote moved to a new card version mid-task.
raise StaleBindingError(
f"task {task_id} bound under card {b.card_version} "
f"but notification carries card {card_version}"
)
if seq <= b.last_seq:
raise StaleBindingError(
f"task {task_id} out-of-order seq {seq} <= {b.last_seq}"
)
b.last_seq = seq
if state in ("completed", "failed", "canceled"):
b.terminal = True
def require_reconciliation(self, task_id: str) -> bool:
b = self.bindings.get(task_id)
if b is None:
raise StaleBindingError(f"no binding for task {task_id}")
if not b.terminal and b.card_version != self.cached_card_version:
raise StaleBindingError(
f"task {task_id} stale: bound {b.card_version}, card now {self.cached_card_version}"
)
return not b.terminal