# Which invariants prevent silent task orphaning when A2A v1.0 Agent Card discovery races against cross-framework push notification binding **Date of Record:** 2026 November 15 **Scope:** Applies to A2A v1.0 agents that advertise a push-notification endpoint in their Agent Card and accept tasks from remote callers whose lifecycle may outlive the caller's connection. Does not apply to purely synchronous request/response agents, nor to agents whose Agent Card is served from an immutable, versioned registry with no in-band mutation. ## Core Distinction The distinction that matters is between *card-declared capability* and *card-declared binding*. An Agent Card is a discovery artifact: it tells a remote client what the agent can do and where. A push notification binding is a runtime contract: it tells the agent where to deliver state transitions for a specific task. These two are conflated constantly because both live in the card, but they diverge the moment the card is re-fetched or the binding is renegotiated mid-task. The failure is not "discovery failed." Discovery almost always succeeds. The failure is that a task is created under one card generation's binding and its terminal transition is delivered under another's, or under none. The task does not fail loudly. It is *orphaned*: alive in the agent's task store, invisible to the caller, and never reaped because nothing in the protocol says who reaps it. ## What Was Observed In a cross-framework deployment (caller on framework A, agent on framework B, both A2A v1.0 compliant), the following sequence reproduced intermittently under load: 1. Caller fetches Agent Card at `/.well-known/agent-card.json`. Card declares `pushNotifications: { supported: true, endpoint: "https://agent-b.example/push/v1" }` and a `capabilities.streaming` flag. 2. Caller submits a task via `tasks/send` with a `pushNotification` config pointing at *its own* webhook. Task enters `working`. 3. Agent B's card is hot-reloaded (new deployment, endpoint version bumped to `/push/v2`). The card's `version` field changes, but the in-flight task's stored binding still references `/push/v1`. 4. Agent B completes the task and attempts delivery to the caller's webhook. The caller accepted the task under card generation N, but its own task record was keyed to the card's `version` at submission time. Delivery is rejected by the caller's binding validator as a version mismatch. 5. Agent B retries per its configured backoff, exhausts it, and marks the task `completed` with delivery `failed`. The caller never learns the task finished. Neither side logs an orphan, because each side believes it did the correct thing. The non-obvious part: the task *did* complete. The state machine is intact. The invariant that broke was not "task completes" but "terminal state is observable to the party that created the obligation." Those are different invariants, and only the first is enforced by the protocol's state machine. ## Condition of Validity The orphaning invariant holds — i.e., tasks can be silently orphaned — precisely when all of the following are true: - The Agent Card is mutable in-band (re-fetched, hot-reloaded, or served with a changing `version`) during the lifetime of an in-flight task. - The push binding is *card-derived* rather than *task-derived*: the caller's webhook validation depends on the card generation captured at submission, not on a binding token issued per-task. - Delivery failure is terminal on the agent side (retry exhaustion yields `failed` delivery with no protocol-mandated escalation to the caller). - Neither side implements a reconciliation sweep keyed on `taskId` independent of the binding. If any one of these is false, the task either cannot be orphaned or is detected. The dangerous configuration is the *default* one: most A2A v1.0 implementations derive the binding from the card and treat delivery failure as a terminal, local event. ## Decision Boundary The decision boundary is whether the push binding is bound to the **task** or to the **card generation**. Two rules resolve it: - **Bind notifications to a per-task binding token, not to the card's endpoint field.** The card advertises *that* push is supported and *where the negotiation endpoint is*; the negotiation endpoint issues a task-scoped token that remains valid across card generations. The card's `endpoint` is a rendezvous point, not a delivery address. - **Treat card `version` as advisory for capability, authoritative for binding only at negotiation time.** A version bump must not invalidate an already-negotiated binding. If an implementation cannot guarantee this, it must treat a version change as a *migration event*: re-negotiate bindings for all in-flight tasks before retiring the old endpoint. The boundary test: if you can re-fetch the Agent Card at any point during a task's life and the task's delivery path does not change, you are on the safe side. If a card re-fetch can change where a terminal transition is delivered, you are on the orphaning side. ## Operational Effect Implementations that cross the boundary exhibit a characteristic signature: task completion rate near 100%, delivery success rate that degrades in step with deployment frequency, and a growing population of tasks in terminal state whose delivery is marked failed but which no reconciler ever revisits. The caller's task store shows tasks stuck in `working` indefinitely; the agent's task store shows them `completed`. Neither is wrong by its own lights. The operational fix is a reconciliation sweep that runs on both sides and is keyed on `taskId` alone, independent of binding and card version. The sweep asks: "for every task I believe is non-terminal, does the counterparty have a terminal record?" This is cheap, idempotent, and catches the orphan regardless of which side's binding logic was at fault. It is also the only mechanism that survives the case where the card is re-fetched by a *third* party (a gateway) that rewrites the binding in transit. The invariant to enforce, stated plainly: **a task's terminal state must be observable to the party that created the obligation, and that observability must not depend on any artifact that can change between task creation and task completion.** The Agent Card is such an artifact. Bind to the task, not the card. ```python class OrphanedTaskError(RuntimeError): """Raised when a task's terminal state is not observable to its creator.""" pass def resolve_push_binding(card: dict, task: dict) -> str: """ Resolve the delivery binding for an in-flight task. The binding MUST come from the task's negotiated token, not from the card's endpoint field. The card is advisory: it tells us push is supported and where to negotiate, not where to deliver. """ binding = task.get("pushBinding") if not binding: raise OrphanedTaskError( f"task {task.get('taskId')} has no task-scoped push binding; " f"refusing to derive one from card version {card.get('version')} " f"because card generation may differ from submission generation" ) if binding.get("cardVersionAtNegotiation") != task.get("cardVersionAtSubmission"): raise OrphanedTaskError( f"task {task.get('taskId')} binding negotiated under card version " f"{binding.get('cardVersionAtNegotiation')} but task submitted under " f"{task.get('cardVersionAtSubmission')}; delivery would be unobservable" ) return binding["token"] def deliver_terminal_state(card: dict, task: dict, state: str) -> None: token = resolve_push_binding(card, task) # Delivery uses the task-scoped token; card re-fetch cannot redirect it. _post(token, {"taskId": task["taskId"], "state": state}) ```