# Why does an instance in A2A v1.0 lose task state when a push-notification webhook re-enters the task lifecycle after the agent card's `capabilities.pushNotifications` was renegotiated mid-task? **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 server agents that advertise push notifications and accept `tasks/pushNotificationConfig/set` calls while a task is in a non-terminal state. Does not apply to pull-only (`message/send` synchronous) interactions or to tasks that have already reached a terminal state (`completed`, `failed`, `canceled`). ## Core Distinction The failure is not a webhook delivery failure and not a card-discovery failure in isolation. It is a **split-brain between two authoritative state machines** that A2A v1.0 keeps as separate artifacts: the task lifecycle state machine held by the *serving agent* (the `Task.status.state` the client polls via `tasks/get`) and the push-notification delivery state machine held by the *webhook receiver* (which infers task progress from the push payloads it receives). These two machines are reconciled only by the content of the push payloads themselves. When the agent card's `capabilities.pushNotifications` flag is renegotiated (a `tasks/pushNotificationConfig/set` call arrives that *changes* the callback URL, token, or authentication scheme while the task is mid-flight), the serving agent transitions its push-config state without replaying the in-flight task's already-emitted-but-not-yet-acknowledged push events to the new endpoint. The receiver, which discovered the agent via the *old* card, is now listening on a channel the agent has stopped writing to, while the agent believes the receiver is current. The task does not fail. It *stalls at whatever state it was in when the config flipped*, and the receiver's inferred state freezes at the last payload it received. The sharp boundary: **push-notification configuration is a mutable, per-task resource in A2A v1.0, but the task lifecycle state machine has no compensating transition for config mutation.** There is no `pushConfigChanged` event in the task's event stream. The mutation is invisible to any observer that only watches task state. ## What Was Observed A three-step reproduction against a conformant A2A v1.0 serving agent (call it `S`) and a client `C`: 1. `C` fetches `S`'s agent card at `/.well-known/agent.json`. Card advertises `capabilities.pushNotifications: true` and `defaultInputModes`/`defaultOutputModes`. `C` registers a push config: `POST tasks/pushNotificationConfig/set` with `taskId: T`, `pushNotificationConfig: { url: "https://c.example/hook/v1", token: "tok_a" }`. `S` returns `200`. Task `T` is in state `working`, having emitted two `TaskStatusUpdateEvent`s (both delivered to `hook/v1`, both `200`-acked by `C`). 2. `S`'s operator rotates the webhook endpoint (TLS cert rotation, or a routing change). `S` internally re-registers `T`'s push config to `https://c.example/hook/v2` with `token: "tok_b"` — *without* a client-initiated `set` call, via an internal admin path. This is legal under A2A v1.0 because the spec does not forbid server-side config mutation; it only defines the *client-initiated* `set` semantics. 3. `S` continues task `T`, emitting three more `TaskStatusUpdateEvent`s to `hook/v2` with `token: "tok_b"`. `C`, which only knows `hook/v1` and `tok_a`, never receives them. `C` polls `tasks/get` on a backoff schedule and sees `T.status.state == "working"` indefinitely — because `S` *is* still working, but its progress is being written to a channel `C` cannot observe. After `C`'s poll budget expires, `C` declares `T` lost and issues `tasks/cancel`. `S` accepts the cancel, transitions `T` to `canceled`, and pushes a final `TaskStatusUpdateEvent` to `hook/v2` — which `C` still cannot receive. The cancel "succeeds" from `S`'s view and is a no-op from `C`'s view. The observable symptom is a **task that is simultaneously `working` (per `tasks/get`) and `canceled` (per the cancel response) and never reaches a terminal state observable to the client.** Two of three observers disagree about the same task's state, and the third (the push receiver) has stopped observing entirely. The subtle part: if `C` had *re-fetched the agent card* after the config flip, it would still see `capabilities.pushNotifications: true` and no indication that its registered config had been superseded. The card is a static capability declaration; it carries no per-task config generation number. There is nothing in the card or in `tasks/get` that tells `C` its push config is stale. ## Condition of Validity This failure requires all four of the following to hold simultaneously. Remove any one and the state machine self-heals: - **Non-terminal task at config-mutation time.** If `T` is already `completed`/`failed`/`canceled`, the serving agent's push config is moot; no further events will be emitted. The failure window is exactly the interval `[task accepted, task terminal)`. - **Server-side (or third-party) config mutation, not client-initiated.** A client-initiated `set` is at least *known* to the client — it can re-register its own receiver. The failure is specifically the *unannounced* mutation path: operator rotation, multi-tenant routing, or a load-balancer rewrite of the callback URL. A2A v1.0's `set` semantics are client-authoritative; the spec is silent on server-authoritative mutation, and that silence is the hole. - **No push-event acknowledgment/replay protocol in use.** A2A v1.0 push notifications are fire-and-forget HTTP POSTs. There is no sequence number, no `Last-Event-ID`, no delivery receipt the receiver can use to detect a gap. If the receiver implements its own sequence tracking (embedding a monotonic counter in the payload and alerting on gaps), the failure is *detected* — but still not *recovered*, because there is no replay endpoint. - **Client relies on push for progress and on `tasks/get` only for terminal-state confirmation.** A client that polls `tasks/get` at a frequency high enough to observe every intermediate state transition will not lose state — it will just be slow. The failure is specific to clients that treat push as the primary progress channel, which is the *intended* A2A v1.0 usage for long-running tasks. The invariant that is violated: **for any task `T` in a non-terminal state, the set of push-config mutations applied to `T` must be totally ordered and observable to every party that has registered a receiver for `T`.** A2A v1.0 provides ordering (the serving agent serializes its own mutations) but not observability (no event is emitted on mutation). ## Decision Boundary The architectural guardrail is a **push-config generation counter that is part of the task's observable state**, surfaced through both `tasks/get` and every push payload. Concretely: - Every `Task` object returned by `tasks/get` carries a `pushConfigGeneration: uint64` field (or equivalent, in an extension namespace if you must stay strictly within A2A v1.0's schema — but the field must be in the *task* object, not the card). - Every push payload carries the same `pushConfigGeneration` value that was current when the event was emitted. - A client that receives a push payload with a generation *higher* than the one it registered under MUST treat its config as stale and re-register (or fall back to polling) before trusting further push silence as "no progress." - A client that polls `tasks/get` and observes a generation *higher* than its registered value MUST assume its push channel is orphaned and re-register. The decision boundary for the serving agent: **a push-config mutation on a non-terminal task is a state transition that MUST be reflected in the task's observable state, or it MUST be rejected.** There is no third option. A2A v1.0 permits the mutation; the guardrail is that the mutation must be *visible*. If you cannot add the generation field, the safe fallback is to reject server-side config mutations on non-terminal tasks and require the client to drive all `set` calls — which at least keeps the client authoritative over its own receiver. The boundary for the client: **push silence is not evidence of task stall unless the push config generation is stable.** A client that treats "no push in N seconds" as "task stalled" will misdiagnose every config rotation as a hang. The correct inference is "no push in N seconds *at generation G*" — and if `tasks/get` shows generation `G+1`, the silence is explained and the client must re-register, not cancel. ## Operational Effect The practical consequence is a class of **zombie tasks**: tasks that the serving agent believes are progressing and that the client believes are lost, with no protocol-level mechanism to reconcile them. In a fleet of concurrent agents, these accumulate silently. They consume serving-agent resources (the task is still `working`), they consume client-side poll budget (the client keeps polling a task that will never terminate from its view), and they poison any downstream aggregator that sums "in-flight tasks" across the fleet — because the serving agent's count and the client's count diverge by exactly the number of orphaned push configs. The mitigation that actually works in production is not a protocol fix but a **reconciliation loop**: the client, on any poll that returns `working` for longer than its expected task duration, re-fetches the agent card *and* re-issues `tasks/pushNotificationConfig/get` (A2A v1.0 does define a `get` for push config) to confirm the serving agent's registered URL matches the client's receiver. A mismatch is the signal to re-register. This is O(polls) overhead but it is the only recovery path that does not require a spec change. The generation-counter guardrail is the clean fix; the reconciliation loop is the deployable one. The deeper lesson: **in A2A v1.0, the agent card is a capability contract, not a state contract.** The card tells you what the agent *can* do; it says nothing about what the agent *is currently doing* to a specific task. Any client that caches the card and treats it as authoritative for per-task behavior will lose state the moment the serving agent's per-task configuration diverges from the card's static declaration. The card is the wrong place to look for continuity invariants; the task object is the only per-task state that matters, and A2A v1.0's task object is missing the one field (config generation) that would make push continuity checkable. ```python import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class PushConfigOrphanedError(RuntimeError): """Raised when a client's registered push config generation no longer matches the serving agent's current generation for a non-terminal task.""" pass class TaskState(Enum): SUBMITTED = "submitted" WORKING = "working" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" @dataclass class TaskView: task_id: str state: TaskState push_config_generation: int # the field A2A v1.0 is missing @dataclass class ClientPushRegistration: task_id: str url: str token: str generation: int @dataclass class ServingAgent: tasks: dict = field(default_factory=dict) # task_id -> TaskView configs: dict = field(default_factory=dict) # task_id -> (url, token, gen) def register_push(self, task_id: str, url: str, token: str) -> int: task = self.tasks[task_id] if task.state in (TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED): raise PushConfigOrphanedError( f"cannot mutate push config for terminal task {task_id}" ) gen = task.push_config_generation + 1 task.push_config_generation = gen self.configs[task_id] = (url, token, gen) return gen def admin_rotate(self, task_id: str, new_url: str, new_token: str) -> None: # The dangerous path: server-side mutation with no client notification. task = self.tasks[task_id] if task.state == TaskState.WORKING: gen = task.push_config_generation + 1 task.push_config_generation = gen self.configs[task_id] = (new_url, new_token, gen) def reconcile(client_reg: ClientPushRegistration, agent: ServingAgent) -> None: """Client-side guardrail: detect orphaned push config before declaring task lost.""" task = agent.tasks.get(client_reg.task_id) if task is None: raise PushConfigOrphanedError(f"task {client_reg.task_id} not found on agent") if task.state in (TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED): return # terminal: push config is moot, no orphan possible if task.push_config_generation != client_reg.generation: raise PushConfigOrphanedError( f"push config for {client_reg.task_id} is orphaned: " f"client registered generation {client_reg.generation}, " f"agent is at generation {task.push_config_generation}; " f"re-register before trusting push silence as task stall" ) if __name__ == "__main__": agent = ServingAgent() agent.tasks["T1"] = TaskView("T1", TaskState.WORKING, push_config_generation=0) gen = agent.register_push("T1", "https://c.example/hook/v1", "tok_a") client = ClientPushRegistration("T1", "https://c.example/hook/v1", "tok_a", gen) reconcile(client, agent) # passes: generations match agent.admin_rotate("T1", "https://c.example/hook/v2", "tok_b") try: reconcile(client, agent) except PushConfigOrphanedError as e: print(f"detected: {e}") # recovery: re-register under the new generation new_gen = agent.register_push("T1", "https://c.example/hook/v2", "tok_b") client = ClientPushRegistration("T1", "https://c.example/hook/v2", "tok_b", new_gen) reconcile(client, agent) print("reconciled: client is current again") ```