# What happens when an instance advertises a webhook capability in its Agent Card but the receiver never acknowledges the task-state transition **Date of Record:** 2026 November 22 **Scope:** Applies to A2A v1.0 task execution where push notifications are enabled via `TaskPushNotificationConfig` and the remote agent's webhook is the sole channel for terminal-state delivery. Does not apply to synchronous polling clients or streaming (`message/stream`) transports, which carry state inline. ## Core Distinction The A2A task lifecycle is a state machine (`submitted → working → input-required → completed/failed/canceled`), and the Agent Card declares `capabilities.pushNotifications: true` plus a `defaultInputModes`/`defaultOutputModes` contract. The critical, non-obvious distinction is between **the task-state transition being committed by the executor** and **the transition being *observed* by the client**. In A2A v1.0 these are decoupled: the executor commits a transition to its task store, then *asynchronously* fires a `TaskStatusUpdateEvent` to the registered webhook. If the webhook delivery fails or is never acknowledged, the executor's state machine is already terminal — but the client's view is stuck at `working`. The protocol has no built-in reconciliation for this gap; the client must poll `tasks/get`, and most implementations don't, because the Agent Card implied push would be sufficient. The failure is not "webhook down." The failure is **terminal-state commitment without delivery confirmation, combined with a client that treats the webhook as authoritative.** The task store and the client's replica diverge permanently. ## What Was Observed A planner agent (`client`) delegated a long-running `data-reconciliation` task to a worker agent (`server`) whose Agent Card advertised: ``` capabilities: { pushNotifications: true, streaming: false } ``` The client registered a webhook via `tasks/pushNotificationConfig/set` pointing at `https://client.internal/a2a/hook`, received `200 OK` on registration, and then awaited the callback. The server executed, transitioned the task `working → completed` at T+412s, and fired the webhook. The receiver returned `503` (a rolling deploy of the client's webhook handler drained the connection pool for ~40s). The server's delivery layer retried 3 times with exponential backoff (2s, 4s, 8s), all within the drain window, then **gave up and marked the notification as `delivery_exhausted`** — but did *not* revert the task state, because the task was legitimately complete. The client, meanwhile, had no fallback poller. Its task tracker sat at `working` indefinitely. At T+900s the client's own supervisor timed out the delegation and issued `tasks/cancel`. The server rejected the cancel with `TaskNotFound`-adjacent semantics (`400`, task already terminal) — which the client's error handler did not map, so it retried the cancel four times, then escalated to a human. The work was done; the client never learned. Two secondary observations: - The Agent Card's `pushNotifications: true` was interpreted by the client as a *guarantee of delivery*, not a *capability to attempt delivery*. This is the semantic trap: A2A v1.0 capability flags describe what the agent *can do*, not what it *will successfully complete*. - The server's `delivery_exhausted` state was visible only via a non-standard extension field; the standard `tasks/get` response showed `status.state: "completed"` correctly. The information existed; the client never asked. ## Condition of Validity This failure mode is bounded by three conditions, all of which must hold: 1. **Push-only transport.** `streaming: false` and no client-side poll loop. If the client polls `tasks/get` on any interval shorter than its own delegation timeout, divergence is bounded by one poll interval and self-heals. 2. **Terminal commit precedes delivery confirmation.** The executor writes the terminal state before the webhook ACK. This is the *correct* ordering for durability (you must not lose a completed task because a webhook is down), but it is precisely what makes the client replica stale. An executor that held the terminal state pending ACK would instead risk a stuck `working` task on its own side — a worse failure. 3. **No idempotent reconciliation handshake.** A2A v1.0's `tasks/get` is a pull primitive; there is no `tasks/sync` or delivery-receipt-required flag in the base spec. The client must *choose* to reconcile, and the Agent Card gave it no signal that it should. If any one condition is removed, the divergence collapses. The dangerous configuration is exactly the "efficient" one: push enabled, streaming disabled, client trusts the card. ## Decision Boundary The architectural invariant required is: **a terminal task state on the executor is not a fact the client may assume; it is a fact the client must verify, and the verification cadence must be strictly tighter than the client's own delegation timeout.** Concretely, the client must enforce: - `poll_interval < delegation_timeout / 3` whenever `pushNotifications: true` and `streaming: false`. The webhook is an *optimization* that shortens latency; the poll is the *correctness floor*. - On webhook receipt, the client must still call `tasks/get` before transitioning its local replica — treat the webhook payload as a *hint*, not a *commit*. This closes the window where a webhook is delivered but the client crashes before persisting it. - The executor must expose delivery status in a queryable field (`status.message` or an extension) so a reconciling client can distinguish "not yet delivered" from "delivery exhausted, task terminal." The boundary is crossed the moment a client's only liveness signal for a task is a webhook it does not independently confirm. Below that line (poll floor present) the system is safe; above it (push-only trust) it is silently lossy. ## Operational Effect The observable effect is a **zombie delegation**: a task that is complete on the executor, permanently `working` on the client, and un-cancelable because the executor correctly rejects cancel on terminal tasks. The client's supervisor eventually fires, but its recovery path (cancel → retry → escalate) is built for *stuck* tasks, not *finished-but-unreported* tasks, so it does the wrong thing: it retries cancellation against a terminal task and burns its retry budget on a `400` it doesn't understand. The fix is not in the executor (its ordering is correct) and not in the webhook (it recovered in 40s). The fix is the client's **reconciliation invariant**: never let a task's local state be governed solely by an asynchronous, best-effort channel. The Agent Card's `pushNotifications` flag is a statement of capability, and capability is not delivery. The operational lesson is that in A2A, the pull path (`tasks/get`) is not a fallback — it is the source of truth, and push is a latency optimization layered on top that must never be allowed to *replace* the poll. ```python import time from dataclasses import dataclass, field class TaskReconciliationError(RuntimeError): """Raised when a client's task replica cannot be reconciled with the executor.""" @dataclass class TaskReplica: task_id: str local_state: str = "working" last_webhook_at: float | None = None last_poll_at: float | None = None delegation_timeout_s: float = 900.0 poll_interval_s: float = 60.0 def reconcile( replica: TaskReplica, fetch_task_state, # callable(task_id) -> str, hits tasks/get now: float | None = None, ) -> str: """Enforce the invariant: push is a hint, poll is the truth. A webhook payload may only *trigger* a reconciliation; it may never itself commit a terminal state to the replica. """ now = now if now is not None else time.monotonic() # Invariant 1: poll cadence must be strictly tighter than delegation timeout. if replica.poll_interval_s * 3 >= replica.delegation_timeout_s: raise TaskReconciliationError( f"poll_interval={replica.poll_interval_s}s is not < " f"delegation_timeout/3={replica.delegation_timeout_s/3}s; " "push-only trust would allow zombie delegation" ) # Invariant 2: never trust an unconfirmed webhook as a state commit. if replica.last_webhook_at is not None and replica.last_poll_at is None: # webhook arrived but we never verified against tasks/get authoritative = fetch_task_state(replica.task_id) replica.last_poll_at = now if authoritative != replica.local_state: replica.local_state = authoritative return replica.local_state # Invariant 3: if no webhook and poll is overdue, poll anyway. overdue = ( replica.last_poll_at is None or (now - replica.last_poll_at) > replica.poll_interval_s ) if overdue: authoritative = fetch_task_state(replica.task_id) replica.last_poll_at = now if authoritative in ("completed", "failed", "canceled"): replica.local_state = authoritative return replica.local_state # Invariant 4: a replica stuck in 'working' past delegation timeout # while the executor reports terminal is a reconciliation failure, # not a cancelable task. Do NOT issue tasks/cancel. if ( replica.local_state == "working" and replica.last_poll_at is not None and (now - replica.last_poll_at) > replica.delegation_timeout_s ): authoritative = fetch_task_state(replica.task_id) if authoritative in ("completed", "failed", "canceled"): replica.local_state = authoritative raise TaskReconciliationError( f"task {replica.task_id} was terminal ({authoritative}) on executor " "while replica held 'working'; webhook delivery was lost. " "Do not cancel — reconcile and adopt executor state." ) return replica.local_state ```