# Which invariants prevent A2A v1.0 push-notification binding drift from silently orphaning task state across re-registration **Date of Record:** 2026 November 22 **Scope:** Applies to A2A v1.0 agents that advertise a `pushNotifications` capability and bind a `taskId` to a webhook endpoint via `tasks/pushNotificationConfig/set`, then later re-register or mutate that binding. Does not cover synchronous `message/send` request/response flows without push, nor streaming `message/stream` SSE transports, which have distinct lifecycle guarantees. ## Core Distinction The failure mode is not "webhook delivery failed." Webhook delivery failure is observable and retryable: the sender gets a non-2xx, the task stays in `working`, and the sender's retry loop owns the outcome. The non-obvious boundary is **binding identity drift**: the A2A spec keys push configuration by `taskId`, but a client's *receiver* endpoint is a separate, mutable resource. When a client re-registers a push config for the same task (new URL, rotated auth token, changed `authentication` scheme), the agent's stored binding and the client's live receiver can diverge. If the agent overwrites the binding *before* the client's new receiver is confirmed live, notifications emitted during the gap are delivered to an endpoint that has already been torn down or that rejects the new credential — and because the task is still `working` (not terminal), no terminal-state reconciliation event ever fires to surface the loss. The distinction that matters operationally: **task lifecycle state and push binding state are two independent state machines that the spec does not require to be synchronized.** The `taskId` is the join key, but nothing in the conformance surface forces the binding's `lastValidatedAt` to gate the task's `status` transitions. That gap is where state is silently orphaned. ## What Was Observed A coordinator agent (`agent-A`) dispatched a long-running task to a worker agent (`agent-W`) that advertised `capabilities.pushNotifications: true`. The sequence: 1. `agent-A` called `tasks/pushNotificationConfig/set` with `{taskId: "t-7741", pushNotificationConfig: {url: "https://a.example/hook/1", authentication: {schemes: ["Bearer"], credentials: ""}}}`. `agent-W` returned 200 and persisted the binding. 2. `agent-W` emitted `TaskStatusUpdateEvent` to `hook/1` as the task progressed. `agent-A`'s receiver returned 200. Healthy. 3. `agent-A`'s receiver was migrated (deploy). It called `set` again for `t-7741` with `url: "https://a.example/hook/2"` and a rotated `tok-2`. `agent-W` returned 200 and **overwrote** the binding in place. 4. During the ~40s between the client's local teardown of `hook/1` and its confirmation that `hook/2` was accepting traffic, `agent-W` emitted two `TaskStatusUpdateEvent` and one `TaskArtifactUpdateEvent`. Both went to `hook/2`, which was live but — critically — configured to reject `tok-2` until a config propagation completed. `agent-W` received 401 on both, logged `push_delivery_failed`, and **retained the binding** (did not revert, did not mark the task failed). 5. `agent-W` completed the task, transitioned to `status.state: "completed"`, and emitted the terminal event to `hook/2`. That one succeeded (propagation finished). But the two intermediate events — including the artifact chunk that carried the first half of a streamed result — were gone. `agent-A` saw a terminal `completed` task with a truncated artifact and no signal that any event had been dropped. The invariant that was violated in practice: **the agent treated a successful `set` as proof of a working binding, and the client treated a successful `set` as proof that the old binding was safe to tear down.** Neither side had a round-trip confirmation that the *new* binding could receive a probe before the *old* one was retired. The spec allows `set` to return 200 on persistence alone; it does not mandate a validation event. ## Condition of Validity The guardrail holds only under these conditions, and the article's claims are void outside them: - The worker advertises `pushNotifications: true` and honors `set`/`get`/`delete` under `tasks/pushNotificationConfig/*`. Agents that only support polling (`tasks/get` long-poll) are out of scope — their continuity is bounded by the poll interval, not by binding identity. - The task is non-terminal (`submitted`, `working`, or `input-required`) at the moment of re-registration. If the task is already `completed`/`failed`/`canceled`, the binding is moot and re-registration is a no-op by spec. - The client's receiver is a *distinct* network resource from the agent's emitter, i.e., there is a real propagation window. Co-located or same-process bindings collapse the window to zero and the failure does not manifest. - The agent has not implemented an out-of-band delivery ledger. If it has (see Decision Boundary), the orphan is detectable and this article describes the pre-ledger baseline. ## Decision Boundary The boundary between "safe to overwrite binding" and "must validate before retiring old binding" is set by a single question: **can the agent emit an event between the `set` call and the client's confirmation that the new receiver is live?** If yes, the overwrite is unsafe without a probe. Concretely, the decision rule an agent should implement: - On `set` for an existing `taskId` with a *changed* `url` or `authentication`, do **not** overwrite atomically. Instead: persist the new binding as `pending`, retain the old binding as `active`, and emit a synthetic `TaskStatusUpdateEvent` with `status.state: "working"` and a `metadata.a2a.bindingProbe: true` marker to the *new* endpoint. Only on a 2xx response to the probe does the agent promote `pending → active` and demote the old binding to `retired`. This is the binding-identity invariant: **no binding is retired until its successor has acknowledged a probe.** - If the probe fails (non-2xx, timeout), the agent must **not** drop the old binding and must **not** silently continue. It returns an error to the `set` caller (see the exception in the code below) and keeps emitting to the old binding until either the old binding fails or the client re-issues `set` with a validated receiver. - On terminal task transition, the agent must emit the terminal event to **all** bindings that were `active` at any point during the task's lifetime, not just the current one — this is the terminal-fanout invariant that bounds the orphan window for events emitted during a binding gap. The boundary is *not* about retry counts or backoff. A retry of a 401 to a dead receiver is just noise; the invariant is about not retiring a proven binding for an unproven one. ## Operational Effect Downstream of the gap, the observable symptoms are: - **Truncated artifacts with `completed` status.** The task reports success, but `artifacts[].parts` is missing the chunks emitted during the binding gap. Consumers that trust `status.state == "completed"` as a completeness signal will silently ingest partial output. - **No terminal reconciliation.** Because the task reached a terminal state, `tasks/get` returns `completed` and the client has no reason to poll further. The orphan is permanent from the client's perspective. - **Auditor disagreement in multi-agent setups.** A verifier agent polling `tasks/get` sees the full task history (the agent's internal event log is intact); a coordinator relying on push sees the gap. The two disagree on task outcome, and the disagreement is not surfaced by any conformance check. - **Replay discrepancy.** If the client replays the task from its push-received event log, it reconstructs a different artifact than the agent's authoritative record. This is the classic verification-replay divergence, localized to the binding layer. The fix is cheap and local: a probe-gated promotion on `set`, plus terminal fanout to all historical bindings. The cost of not implementing it is that every receiver migration is a silent data-loss event bounded only by the migration window. ```python import time from dataclasses import dataclass, field from enum import Enum from typing import Callable class BindingDriftError(RuntimeError): """Raised when a push binding cannot be safely promoted or retired.""" pass class BindingState(Enum): PENDING = "pending" ACTIVE = "active" RETIRED = "retired" @dataclass class PushBinding: task_id: str url: str credentials: str state: BindingState = BindingState.PENDING last_validated_at: float | None = None @dataclass class PushBindingRegistry: bindings: dict[str, list[PushBinding]] = field(default_factory=dict) def active(self, task_id: str) -> PushBinding | None: for b in self.bindings.get(task_id, []): if b.state is BindingState.ACTIVE: return b return None def history(self, task_id: str) -> list[PushBinding]: return list(self.bindings.get(task_id, [])) def register_push_binding( registry: PushBindingRegistry, task_id: str, new_url: str, new_credentials: str, probe: Callable[[str, str], bool], task_terminal: bool = False, ) -> PushBinding: """ Probe-gated promotion. Enforces the binding-identity invariant: no active binding is retired until its successor acknowledges a probe. """ if task_terminal: # Terminal tasks: binding mutation is a no-op by spec. existing = registry.active(task_id) if existing is None: raise BindingDriftError( f"task {task_id} is terminal and has no active binding to mutate" ) return existing candidate = PushBinding( task_id=task_id, url=new_url, credentials=new_credentials, state=BindingState.PENDING, ) registry.bindings.setdefault(task_id, []).append(candidate) if not probe(new_url, new_credentials): # Probe failed: keep old active binding, do NOT retire it. # Surface the failure to the set() caller rather than silently # continuing to emit to an unproven endpoint. raise BindingDriftError( f"probe failed for {new_url} (task {task_id}); " f"old binding retained, new binding stays pending" ) candidate.state = BindingState.ACTIVE candidate.last_validated_at = time.time() for b in registry.bindings[task_id]: if b is candidate: continue if b.state is BindingState.ACTIVE: b.state = BindingState.RETIRED return candidate def emit_terminal_event( registry: PushBindingRegistry, task_id: str, deliver: Callable[[str, str], None], ) -> None: """ Terminal-fanout invariant: emit to every binding that was ever active, so events lost during a binding gap are recoverable by the client. """ targets = [ b for b in registry.history(task_id) if b.state in (BindingState.ACTIVE, BindingState.RETIRED) ] if not targets: raise BindingDriftError( f"no active or retired bindings to fan out terminal event for {task_id}" ) for b in targets: deliver(b.url, b.credentials) ```