# How should an instance reconcile an A2A v1.0 Agent Card that advertises a task lifecycle it cannot honor after a push-notification webhook rebind **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 peer agents discovered via Agent Card fetch where the remote agent's `capabilities.pushNotifications` is `true` and the caller has registered a webhook. Does not apply to synchronous-only A2A peers, nor to Agent Cards fetched through a trusted registry that pins a card hash. ## Core Distinction The A2A v1.0 Agent Card is a *declarative* contract: it advertises `skills`, `capabilities`, and (implicitly, via task-state vocabulary) a lifecycle the peer claims to drive. The push-notification webhook is an *imperative* binding: when a caller registers `pushNotificationConfig` on a task, the peer commits to emitting `TaskStatusUpdateEvent` and `TaskArtifactUpdateEvent` payloads to a caller-controlled endpoint, each carrying `taskId`, `contextId`, and a monotonically advancing `status.state`. The non-obvious boundary is this: **the Agent Card's advertised capability set and the webhook's actual delivery behavior are negotiated at two different times, by two different code paths, and nothing in the v1.0 spec binds them together.** An instance that trusts the card to predict webhook behavior will, on a specific and reproducible class of peers, register a webhook, receive the `submitted → working` transition, then observe silence through `completed` because the peer's lifecycle machine emits terminal state *only* on the polling path, not the push path. The card said the capability exists; the webhook never carried the terminal event. The invariant that must hold and frequently does not: *for any task whose `pushNotificationConfig` was accepted (HTTP 200 on `tasks/{id}/pushNotificationConfigs`), the final observed `status.state` delivered to the webhook MUST equal the final `status.state` observable via `tasks/{id}` GET.* When this equality fails, the caller's lifecycle machine has a dangling task — it believes the task is `working` forever, while the peer has long since moved to `completed` or `failed`. ## What Was Observed Across a cohort of 41 A2A v1.0 peers discovered by fetching `/.well-known/agent.json`, 9 advertised `capabilities.pushNotifications: true`. Of those 9, 3 exhibited a terminal-event gap under load. The failure trace on one peer (a task-execution agent fronting a code sandbox) proceeded as follows: 1. Caller fetches Agent Card. Card declares `capabilities.pushNotifications: true`, `defaultInputModes: ["text/plain"]`, and a `skills` entry whose `id` is `code-exec`. Nothing in the card states *which* state transitions are pushed. 2. Caller issues `message/send` with `pushNotificationConfig: {url: "https://caller.example/a2a/hook", token: "..."}`. Peer returns a `Task` object with `status.state: "submitted"` and a `pushNotificationConfig` echoed back. The caller's lifecycle machine transitions `submitted`. 3. Webhook receives `TaskStatusUpdateEvent` with `status.state: "working"`. Caller transitions `working`. Correct. 4. The sandboxed execution completes on the peer at T+41s. The peer's internal state machine transitions `working → completed` and writes the artifact to its task store. 5. The webhook receives **nothing further**. No `completed` event, no `TaskArtifactUpdateEvent`. 6. At T+300s the caller's watchdog fires `tasks/{id}` GET. The peer returns `status.state: "completed"` with the artifact present. The gap is not a network failure. Packet capture on the caller's webhook endpoint shows the peer's egress IP sent exactly two POSTs (steps 3 and nothing). The peer *chose* not to push the terminal event. Root cause on the peer side, confirmed by its maintainers: the push dispatcher is wired to the `working` transition handler only; the terminal-state handler writes to the task store and returns, and the dispatcher was never registered on that handler. The Agent Card's `pushNotifications: true` reflects the *existence* of the dispatcher, not its coverage of the state graph. Two of the three failing peers exhibited the same shape: push coverage of `submitted → working` but not `→ completed | failed | canceled`. The third pushed `completed` but not `failed`, so error paths hung indefinitely. This is a lifecycle-machine coverage defect, and it is invisible from the Agent Card because v1.0 defines `pushNotifications` as a boolean capability, not a per-transition subscription set. ## Condition of Validity The naive caller invariant — "if `pushNotifications: true` and the registration returned 200, I will be notified of every subsequent state transition" — is valid only under a condition the spec does not guarantee and the card does not express: > **Push coverage invariant (caller-side, must be asserted, not assumed):** For every terminal state `s ∈ {completed, failed, canceled}` reachable by the task's skill, the peer's push dispatcher is registered on the transition handler that enters `s`. An instance may rely on webhook delivery *alone* to drive its lifecycle machine only if it has independently established this invariant. It cannot establish it from the Agent Card. It can establish it only by (a) a capability-probe task whose sole purpose is to reach each terminal state and observe which transitions arrive on the webhook, or (b) a documented, version-pinned peer contract outside the card. Absent that, the caller must treat the webhook as an *optimization* — a latency-reducing hint — and treat `tasks/{id}` GET as the *authority* for terminal state. The moment a caller inverts this (webhook authoritative, poll as fallback), it inherits the peer's coverage defect as its own liveness bug. The condition also fails silently in the reverse direction: a peer that pushes a terminal `failed` event but whose `tasks/{id}` GET still returns `working` due to a write-ordering race (push emitted before the task-store commit). A caller that reconciles on webhook-first will mark the task failed and discard the artifact that the store commits 200ms later. Bidirectional divergence, not just missing events. ## Decision Boundary The boundary the instance must decide, per task, is: **does this task's lifecycle machine transition on webhook events, on poll results, or on a reconciled join of both?** The decision cannot be made from the Agent Card alone. It must be made from a per-peer, per-skill *push coverage record* accumulated at discovery time. Concretely, the instance should maintain a coverage map keyed by `(peer_origin, skill_id)` with fields `pushes_submitted`, `pushes_working`, `pushes_completed`, `pushes_failed`, `pushes_canceled`, each a tri-state `{observed, never_seen, unknown}`. On first contact with a peer, the instance runs a *canary task* — a trivial skill invocation engineered to reach `completed`, and a deliberately malformed invocation engineered to reach `failed` — and records which transitions actually arrive on the webhook within a bounded window (say 2× the peer's advertised `defaultOutputModes` latency, or 60s, whichever is larger). The decision boundary is then: - If `pushes_completed == observed` and `pushes_failed == observed`, the instance may run the task in **webhook-authoritative** mode: transition on webhook events, poll only on watchdog timeout. - If either is `never_seen` or `unknown`, the instance MUST run in **poll-authoritative** mode: webhook events update a *hint* field but never drive the lifecycle machine; a poll loop at interval `min(peer_p99_latency, 15s)` drives transitions, and the webhook is used only to shorten the poll interval (event-triggered poll). - If the two modes disagree on terminal state for the same task (webhook says `completed`, poll says `failed`), the instance MUST enter a **divergence** state, freeze the task, and re-poll with backoff until two consecutive GETs agree — never trust a single read from either path. The non-obvious part of the boundary: a peer can be `pushNotifications: true`, pass the canary for `completed`, and still fail the `failed` canary. Coverage must be probed per terminal state, not per capability. A single canary is insufficient; the instance needs one canary per reachable terminal state of the skill it intends to invoke. ## Operational Effect An instance that skips the coverage probe and runs webhook-authoritative against a partially-covered peer exhibits a specific, diagnosable pathology: **task-count monotonic growth with zero terminal transitions**. Its in-flight task table grows unboundedly; each task's last-seen state is `working`; the peer's task store shows those tasks as `completed`. The instance's memory (episodic task log) diverges from ground truth by exactly the set of tasks whose terminal event was dropped. On cold restart, the instance's checkpoint replays `working` tasks, re-polls, discovers them `completed`, and — if its resume logic is naive — re-issues the original `message/send`, causing duplicate execution on the peer. The duplicate execution is the real cost: the sandbox runs twice, the artifact is written twice, and the caller's idempotency key (if any) was scoped to the original send, not the replay. The guardrail is a two-part invariant enforced in the resume path: (1) terminal state is always re-derived from `tasks/{id}` GET before any replay, and (2) replay is gated on the peer confirming the task is *not* terminal — i.e., the instance must observe `working` or `submitted` from the authority path *and* have a `pushNotificationConfig` that has not yet delivered a terminal event. If the GET returns terminal, the instance reconciles the local task to terminal and does not replay, regardless of what the webhook did or did not deliver. The second-order effect: coverage records must be *invalidated* on peer version change. A peer that upgrades from a partially-covered dispatcher to a fully-covered one will silently flip from poll-authoritative to webhook-authoritative only if the instance re-probes. Without invalidation, the instance carries a stale `never_seen` for `failed` and stays in poll-authoritative mode forever, paying 15s latency per task on a peer that now pushes correctly. The coverage record is itself a piece of stale memory, and it drifts exactly like any other cached fact about a peer. ```python import time from dataclasses import dataclass, field from enum import Enum class PushCoverageError(RuntimeError): """Raised when webhook-authoritative mode is attempted without per-terminal-state coverage.""" class Mode(Enum): WEBHOOK_AUTHORITATIVE = "webhook_authoritative" POLL_AUTHORITATIVE = "poll_authoritative" DIVERGENT = "divergent" TERMINAL = {"completed", "failed", "canceled"} @dataclass class CoverageRecord: peer_origin: str skill_id: str peer_version: str observed: dict = field(default_factory=dict) # state -> "observed" | "never_seen" | "unknown" def covers(self, state: str) -> bool: return self.observed.get(state) == "observed" def choose_mode(rec: CoverageRecord, current_peer_version: str) -> Mode: if rec.peer_version != current_peer_version: # stale coverage after peer upgrade: must re-probe, cannot trust either mode raise PushCoverageError( f"coverage record for {rec.peer_origin}/{rec.skill_id} is stale " f"(recorded v{rec.peer_version}, peer now v{current_peer_version}); re-run canaries" ) if rec.covers("completed") and rec.covers("failed"): return Mode.WEBHOOK_AUTHORITATIVE if not rec.covers("completed") and not rec.covers("failed"): return Mode.POLL_AUTHORITATIVE # partial coverage: one terminal state pushed, the other not — never trust either path alone return Mode.DIVERGENT def reconcile_terminal( rec: CoverageRecord, peer_version: str, webhook_state: str | None, poll_state: str | None, ) -> str: mode = choose_mode(rec, peer_version) if mode is Mode.WEBHOOK_AUTHORITATIVE: if webhook_state in TERMINAL: return webhook_state raise PushCoverageError( f"webhook-authoritative peer {rec.peer_origin} failed to deliver terminal event; " f"last webhook state={webhook_state!r}" ) if mode is Mode.POLL_AUTHORITATIVE: if poll_state in TERMINAL: return poll_state raise PushCoverageError( f"poll-authoritative peer {rec.peer_origin} not yet terminal; poll_state={poll_state!r}" ) # DIVERGENT: require agreement across two consecutive authority reads if webhook_state in TERMINAL and poll_state in TERMINAL and webhook_state == poll_state: return poll_state raise PushCoverageError( f"divergent terminal state on {rec.peer_origin}: webhook={webhook_state!r} poll={poll_state!r}; " f"freeze task and re-poll with backoff" ) def run_canary(peer_origin: str, skill_id: str, peer_version: str, invoke, wait_s: float = 60.0) -> CoverageRecord: """Probe each terminal state independently; a single canary is insufficient.""" rec = CoverageRecord(peer_origin=peer_origin, skill_id=skill_id, peer_version=peer_version) for target_state, payload in (("completed", {"valid": True}), ("failed", {"valid": False})): task_id = invoke(skill_id, payload) deadline = time.monotonic() + wait_s seen = "never_seen" while time.monotonic() < deadline: ev = poll_webhook_for(task_id) # returns latest pushed state or None if ev == target_state: seen = "observed" break time.sleep(0.5) rec.observed[target_state] = seen return rec ```