# Why does an instance of an A2A v1.0 push-notification binding silently re-deliver a terminal task as `working` after a card re-fetch? **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 remote agents that advertise `pushNotifications` in their Agent Card, register a webhook via `tasks/pushNotificationConfig/set`, and drive task state through `submitted → working → (input-required | completed | failed | canceled)`. Does not apply to synchronous-only `message/send` callers that poll `tasks/get`, nor to A2A v0.x cards that lack the `capabilities.pushNotifications` field. ## Core Distinction The failure is not "the push notification was lost." It is the opposite: the notification was delivered *twice*, with the second delivery carrying a stale `status.state` that regressed a terminal task back to `working` in the receiver's local mirror. The distinction that matters is between **event delivery** and **state projection**. A2A push notifications are at-least-once event hints, not authoritative state. The authoritative state is whatever `tasks/get` returns *at the moment of reconciliation*. An agent that treats an inbound push payload as a state transition — rather than as a trigger to re-read canonical state — will faithfully apply a `working` update to a task it already marked `completed`, because the push was queued before the terminal transition but retried after it. The non-obvious part: the regression is *caused by the same card re-fetch that is supposed to make the binding safer*. When the receiving agent re-fetches `/.well-known/agent-card.json` to validate the sender (per the recommended trust check), the card's `capabilities.pushNotifications` and the `pushNotificationConfig` block can have rotated — a new `id`, a new `token`, or a changed `url` — and the sender re-queues undelivered notifications against the *old* config id. The receiver, now holding a new config, matches the inbound `taskId` but not the `pushNotificationConfig.id`, falls through its dedup index, and applies the stale `working` payload as if it were fresh. ## What Was Observed A two-agent pipeline: an orchestrator (`O`) delegates a document-extraction task to a worker (`W`). `W` advertises push support and accepts a config bound to `O`'s webhook. Sequence, reconstructed from `O`'s event log: 1. `O` calls `message/send`, receives `task.id = t-8f2`, state `submitted`. 2. `W` transitions `t-8f2 → working`, fires push #1 (`state: working`, `configId: cfg-A`). Delivered, applied. 3. `W` transitions `t-8f2 → completed`, fires push #2 (`state: completed`, `configId: cfg-A`). **Delivered to a 502-ing webhook; `W` schedules retry with exponential backoff.** 4. `O`'s webhook recovers. `O` re-fetches `W`'s Agent Card to re-validate the sender signature and capability set. The card has rotated: `pushNotificationConfig.id` is now `cfg-B`, `token` changed. `O`'s dedup index is keyed on `(taskId, configId)`, so `cfg-A` entries are evicted as stale. 5. `W`'s retry backoff fires push #2 again. But `W` also replays its outbound queue in FIFO order, and push #1 (`working`, `cfg-A`) had a *later* retry timer than push #2 due to jitter. Push #1 arrives after push #2. 6. `O` receives push #1: `taskId: t-8f2`, `configId: cfg-A`, `state: working`. `cfg-A` is no longer in the index (evicted at step 4), so it is treated as a *new* config binding. `O` applies `working` to its mirror. Its mirror for `t-8f2` regresses from `completed` to `working`. 7. `O`'s downstream consumer sees `t-8f2` as in-flight, re-issues a dependent task, and the pipeline double-counts the extraction. No error is raised anywhere; every component reports success. The regression was invisible in per-component health checks. It surfaced only as a duplicate side effect three hops downstream. ## Condition of Validity This failure requires the conjunction of four conditions; remove any one and the invariant holds: - **At-least-once delivery with independent per-message backoff.** `W` retries each notification on its own timer, so ordering is not preserved across retries. A single ordered queue with head-of-line blocking would not reorder. - **Config rotation coincident with a delivery gap.** The card re-fetch must return a *different* `pushNotificationConfig.id` (or `token`) than the one the in-flight notification was minted under. If the config is stable, the dedup key `(taskId, configId)` still matches and the stale `working` is dropped. - **Receiver dedup keyed on config identity rather than on a monotonic task version.** If `O` deduped on `(taskId, status.timestamp)` or on an A2A `status` sequence number, the out-of-order `working` would be rejected as older than the applied `completed`. - **Receiver applies push payload as state, not as a re-read trigger.** If every push handler issues `tasks/get` before mutating its mirror, the stale payload cannot regress anything — canonical state at `W` is already `completed`. The invariant that bounds this: **a terminal A2A task state is absorbing, and no push payload may transition out of it.** `completed`, `failed`, and `canceled` are sinks. Any inbound notification asserting a non-terminal state for a task already in a sink must be quarantined, not applied. ## Decision Boundary The boundary is where the receiver decides whether an inbound notification is *authoritative* or *advisory*. A2A v1.0 does not mandate which; the spec leaves push semantics to the binding. The operational rule that resolves the ambiguity: - Treat every push notification as **advisory**: a hint that canonical state *may* have changed. Never apply `status.state` from the payload directly. - On receipt, issue `tasks/get` for the `taskId`. Apply the returned state, subject to the absorbing-terminal rule. Discard the payload's `status` if it conflicts with a sink. - Key dedup on `(taskId, status.timestamp)` — or the task's monotonic version if the agent exposes one — **not** on `(taskId, pushNotificationConfig.id)`. Config identity is a routing concern, not an ordering concern. - On card re-fetch that rotates `pushNotificationConfig`, do **not** evict prior config ids from the dedup index until all in-flight retries for that task have drained (bounded by the sender's max backoff, which the card's `capabilities` should advertise). Eviction-on-rotation is the specific trigger. If the receiver cannot afford a `tasks/get` per push (high fan-out), the fallback is to buffer notifications and reconcile on a timer, applying only the highest-versioned state per task and never moving out of a sink. The point is that *some* reconciliation against canonical state is mandatory; the payload alone is insufficient. ## Operational Effect Left unguarded, this failure produces **silent state regression with duplicate side effects** — the worst class of agent bug, because every component's local health is green. The orchestrator's mirror says `working`, the worker says `completed`, and neither is "wrong" from its own vantage; the divergence is only visible in the composed system. Downstream, dependent tasks are re-issued, idempotency keys (if any) are keyed on the *regressed* state and thus miss, and the duplicate extraction is attributed to a "flaky" worker rather than to the notification binding. The fix is cheap but must be structural, not defensive: enforce the absorbing-terminal invariant at the mirror, re-read canonical state on every push, and decouple dedup ordering from config identity. The card re-fetch — the very mechanism meant to harden trust — must not be allowed to reset the receiver's ordering memory. ```python from dataclasses import dataclass from enum import Enum from typing import Optional class TaskState(Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" TERMINAL = {TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED} class StateRegressionError(RuntimeError): """Raised when a push notification would move a task out of a terminal sink.""" pass @dataclass class TaskMirror: task_id: str state: TaskState version: int # monotonic; incremented on every applied transition class PushReceiver: def __init__(self, canonical_lookup): # canonical_lookup(task_id) -> (TaskState, int) authoritative from tasks/get self.canonical_lookup = canonical_lookup self.mirrors: dict[str, TaskMirror] = {} def on_push(self, task_id: str, payload_state: TaskState, payload_config_id: str) -> TaskMirror: mirror = self.mirrors.get(task_id) # Advisory payload: re-read canonical state instead of trusting payload_state. canonical_state, canonical_version = self.canonical_lookup(task_id) if mirror is None: mirror = TaskMirror(task_id, canonical_state, canonical_version) self.mirrors[task_id] = mirror return mirror # Absorbing-terminal invariant: never leave a sink. if mirror.state in TERMINAL and canonical_state not in TERMINAL: raise StateRegressionError( f"task {task_id}: mirror is {mirror.state.value} (sink) but " f"canonical reports {canonical_state.value}; payload " f"{payload_state.value} via config {payload_config_id} rejected" ) # Ordering by canonical version, not by pushNotificationConfig.id. if canonical_version < mirror.version: raise StateRegressionError( f"task {task_id}: stale canonical version {canonical_version} " f"< mirror {mirror.version} (config {payload_config_id})" ) mirror.state = canonical_state mirror.version = canonical_version return mirror ```