# Under what conditions must an instance treat A2A v1.0 push-notification webhook binding as a non-idempotent side effect rather than a resumable subscription **Date of Record:** 2026 November 30 **Scope:** Applies to A2A v1.0 agents that declare `capabilities.pushNotifications: true` in their Agent Card and accept `tasks/pushNotificationConfig/set` requests bound to a task in a non-terminal state. Does not apply to polling-only agents, nor to webhook delivery semantics negotiated under non-A2A transports (e.g., raw MCP notifications), which have no task-scoped binding object. ## Core Distinction The A2A v1.0 task lifecycle (`submitted → working → input-required → completed/failed/canceled`) is a *state machine over the task object*. The push-notification config is a *separate resource* keyed by `(taskId, configId)` that the server stores and uses to emit `TaskStatusUpdateEvent` and `TaskArtifactUpdateEvent` payloads to a caller-supplied `url`. These two resources have different lifetimes, different idempotency guarantees, and — critically — different ownership. The boundary condition: **a `pushNotificationConfig/set` call is only safely retryable if the server's Agent Card advertises the config as a *replaceable singleton per task*; otherwise each accepted `set` creates a new binding, and a client that retries after a timeout (or resumes after a checkpoint) will register N webhooks for one task, receiving N copies of every status event.** The failure is not in the task state machine and not in the webhook transport — it is in the *gap between them*, where the client's mental model of "my subscription" diverges from the server's model of "a set of active configs." ## What Was Observed A two-agent pipeline (orchestrator `O`, worker `W`) where `O` submits a long-running task to `W` and registers a webhook so `O` can be woken on `input-required` rather than polling. `W` advertises: ``` "capabilities": { "pushNotifications": true, "streaming": false } ``` `O`'s discovery step fetches `/.well-known/agent.json`, confirms `pushNotifications: true`, and proceeds. The failure trace: 1. `O` sends `tasks/send` → `W` returns `{id: T1, status: {state: "submitted"}}`. 2. `O` sends `tasks/pushNotificationConfig/set` with `{taskId: T1, pushNotificationConfig: {url: "https://o.example/hook", token: "abc"}}`. `W` accepts, returns `{pushNotificationConfig: {id: "cfg-7", ...}}`. 3. `W` begins work; after 40s it needs clarification and transitions `T1` to `input-required`. It fires the webhook to `https://o.example/hook`. 4. `O`'s HTTP client times out at 30s waiting for the `set` response (step 2's response was slow due to `W`'s config-store write contention). `O`'s retry policy re-issues the identical `set` request. 5. `W`, per its implementation, treats each `set` as a *create* because `configId` was absent in the request. It creates `cfg-8` with the same URL and token. Now two active configs point at the same endpoint. 6. `W` transitions `T1` to `input-required` again after a later `tasks/send` resumption. **Both** `cfg-7` and `cfg-8` fire. `O`'s handler receives two identical `TaskStatusUpdateEvent` payloads with the same `eventId`-equivalent (the task's `status.timestamp` + state), and — because `O`'s handler is not deduplicating — enqueues two clarification prompts, producing a duplicated `tasks/send` that `W` interprets as two independent resumptions of `T1`, corrupting the conversation history. The observable symptom was not "webhook failed." It was **duplicate `input-required` transitions on a single task**, which violates the implicit invariant that a task transitions to `input-required` at most once per `working` interval. The root cause was step 5: the `set` operation was non-idempotent because the server's config store had no uniqueness constraint on `(taskId, url, token)`. ## Condition of Validity The "retry the `set`" pattern is only valid under a conjunction of three conditions, all of which must be verifiable from the Agent Card or an out-of-band probe: 1. **Singleton semantics advertised.** The card must expose a capability flag or the server must document that `pushNotificationConfig/set` with an existing `configId` *replaces* rather than *creates*. A2A v1.0's base spec does not mandate this; it is an implementation choice. Absent an explicit flag, the client MUST assume create-semantics. 2. **`configId` round-trip.** The client must persist the `configId` returned in step 2 and include it on every retry. If the client's checkpoint (e.g., a mid-task resume after context-window truncation) drops the `configId`, the retry is indistinguishable from a fresh create. 3. **Server-side dedup key.** Even with `configId` round-tripped, the server must reject or coalesce a `set` whose `(taskId, url, token)` triple already exists with a different `configId`. Without this, a client that *lost* its `configId` (crash before persisting) will still double-register. If any of the three is unverified, the correct client behavior is to treat `set` as a **non-idempotent side effect**: never retry blindly, and instead re-read the task's current configs (via `tasks/pushNotificationConfig/list` where supported, or a task `get` that echoes configs) before re-issuing. ## Decision Boundary The decision is a function of `(card.capabilities.pushNotifications, card.capabilities.pushNotificationConfigIdempotent?, clientCheckpointDurability)`: - **Idempotent path:** card advertises singleton semantics AND client durably persists `configId` across the checkpoint boundary. Retry is safe; dedup on the client is a defense-in-depth measure, not a correctness requirement. - **Non-idempotent path (the boundary):** either the card is silent on idempotency, OR the client's checkpoint does not survive `configId` (e.g., the config was registered by a sub-agent whose state was distilled into the parent without the opaque `configId`). Here, every `set` is a potential new binding, and the client MUST NOT retry without first reconciling against the server's config list. - **Forbidden path:** card advertises `pushNotifications: true` but the server's `set` endpoint has no `list` counterpart and no idempotency flag. In this case the client cannot safely resume a task across a checkpoint at all — it must either keep the task in `working` and poll, or accept that resumption may orphan a webhook (a leak, not a correctness bug, but a resource leak that `W` may eventually rate-limit against). The subtle trap: `pushNotifications: true` reads as "this agent supports webhooks," which a naive discovery step interprets as "webhooks are a supported, resumable primitive." It is not. It is a supported *delivery mechanism* whose *binding lifecycle* is unspecified. The boundary is crossed the moment a client treats capability-presence as lifecycle-guarantee. ## Operational Effect Once the boundary is crossed, the failure propagates as follows: - **Duplicate event delivery** to the client's handler, which — if the handler is itself an LLM-driven agent — manifests as duplicated reasoning steps. A duplicated `input-required` event causes the orchestrator to re-prompt the user or re-invoke a sub-tool, and the resulting `tasks/send` resumption is applied twice, advancing the task's conversation state past where it should be. - **Non-deterministic divergence** between `O`'s view of `T1`'s history and `W`'s view, because `W` applied two resumptions. Subsequent `tasks/get` returns a history that `O` cannot reconcile with its own transcript — the classic episodic-to-semantic distillation loss, but induced by transport duplication rather than by summarization. - **Webhook leak** if the client never reconciles: orphaned `cfg-7` fires forever on every subsequent status change, and `W`'s outbound queue grows unbounded until it hits a rate limit or drops events, at which point the *legitimate* `cfg-8` deliveries are also dropped. The client now misses `input-required` entirely and the task deadlocks in `input-required` with no wakeup. - **Auditor disagreement** in multi-agent setups: if a third agent `A` audits `O`'s transcript against `W`'s task history, the duplicate resumptions make the two histories irreconcilable, and `A` cannot distinguish "O hallucinated a step" from "W double-applied a real step." The invariant that bounds all of this: **a push-notification config is a task-scoped resource with create-or-replace semantics that must be either advertised or probed, and a client that cannot prove replace-semantics must reconcile before retry.** The guardrail is not in the task state machine; it is in the client's checkpoint schema, which must carry `(taskId, configId, url, token)` as a unit and refuse to resume a task whose config binding cannot be reconstructed. ## Operational Effect (guardrail implementation) The following guard encodes the decision boundary as a precondition on resumption. It refuses to resume a task across a checkpoint if the config binding cannot be proven idempotent, forcing the caller to reconcile or fall back to polling. ```python import hashlib from dataclasses import dataclass from typing import Optional class PushConfigBindingError(RuntimeError): """Raised when a task resumption would re-register a non-idempotent webhook binding.""" @dataclass(frozen=True) class AgentCard: push_notifications: bool push_config_idempotent: Optional[bool] # None == unspecified @dataclass(frozen=True) class Checkpoint: task_id: str config_id: Optional[str] # None if lost during distillation / truncation url: str token: str def binding_fingerprint(cp: Checkpoint) -> str: h = hashlib.sha256() h.update(cp.task_id.encode()) h.update(b"\x00") h.update(cp.url.encode()) h.update(b"\x00") h.update(cp.token.encode()) return h.hexdigest() def assert_resumable(card: AgentCard, cp: Checkpoint, server_configs: list[Checkpoint]) -> str: """ Decide whether a task may be resumed without re-registering a webhook. Returns the config_id to reuse. Raises PushConfigBindingError otherwise. """ if not card.push_notifications: # Polling fallback is the only safe path; caller must not use webhooks. raise PushConfigBindingError( f"task {cp.task_id}: card does not advertise pushNotifications; " "resume via tasks/get polling, not webhook" ) # Case 1: idempotency explicitly advertised -> retry is safe if we have the id. if card.push_config_idempotent is True: if cp.config_id is None: raise PushConfigBindingError( f"task {cp.task_id}: idempotent server but checkpoint lost configId; " "reconcile via tasks/pushNotificationConfig/list before resume" ) return cp.config_id # Case 2: idempotency unspecified or false -> treat set as non-idempotent side effect. fp = binding_fingerprint(cp) matches = [c for c in server_configs if binding_fingerprint(c) == fp] if len(matches) == 1: return matches[0].config_id # type: ignore[return-value] if len(matches) > 1: raise PushConfigBindingError( f"task {cp.task_id}: {len(matches)} duplicate bindings for fingerprint {fp[:12]}; " "server accepted multiple creates for one (task,url,token); " "delete all but one before resume" ) # No existing binding: a fresh set is safe precisely once. if cp.config_id is not None: raise PushConfigBindingError( f"task {cp.task_id}: checkpoint claims configId {cp.config_id} but server has no " "matching config; binding was GC'd or never persisted; re-set once and persist id" ) return "CREATE_ONCE" ```