# Where must an instance reject a resumed A2A task when the peer's Agent Card has silently downgraded its declared `capabilities.pushNotifications` between the initial `tasks/send` and the webhook delivery **Date of Record:** 2026 November 23 **Scope:** Applies to A2A v1.0 task lifecycles where the client registers a push-notification webhook (via `PushNotificationConfig` on `tasks/send` or `tasks/pushNotificationConfig/set`) and later resumes or reconciles the task against a re-fetched Agent Card. Does not cover synchronous `tasks/send` request/response flows with no webhook, nor streaming `message/stream` SSE consumers, which have a different liveness contract. ## Core Distinction The distinction that matters is between **the capability declaration at task-initiation time** and **the capability declaration at webhook-delivery time**. A2A v1.0 treats the Agent Card as a *discovery artifact* fetched from `/.well-known/agent.json`, and the spec permits the card to change between fetches (version bumps, rolling deploys, feature-flag flips). Most client implementations cache the card once at first contact and never re-validate. The failure is not "the card changed"—that is legal. The failure is **treating a task's webhook registration as still valid after the peer's card stops advertising `pushNotifications: true`**, because the peer will now silently drop deliveries while continuing to advance the task state machine server-side. The client's local state says `working`; the peer's state says `completed`; no webhook fires; the task is orphaned. ## What Was Observed Trace from a production reconciliation run against a peer that performed a rolling deploy mid-task: 1. `T0` — Client fetches Agent Card. Card v3 declares `capabilities: {streaming: true, pushNotifications: true}`. `skills[].id` includes `invoice-reconcile`. 2. `T0+2s` — Client issues `tasks/send` with `pushNotificationConfig: {url: "https://client.example/a2a/cb/7f3a", token: "..."}`. Peer responds `Task { id: "t-4412", status: {state: "submitted"} }`. 3. `T0+30s` — Peer begins rolling deploy. New instance serves Card v4 with `capabilities.pushNotifications: false` (feature flag disabled during incident). Load balancer now routes the task's worker to v4. 4. `T0+31s` — Client calls `tasks/get` on `t-4412`. Peer returns `status.state: "working"`. Client's webhook config is *not* echoed back in the `Task` object (A2A v1.0 returns push config only via `tasks/pushNotificationConfig/get`, which the client never re-calls). 5. `T0+90s` — Peer transitions task to `completed` on v4. v4's push dispatcher is gated on `capabilities.pushNotifications`; the gate is false; **no delivery is attempted and no error is returned to any caller**. The task record is updated to `completed` with the webhook config still stored but inert. 6. `T0+300s` — Client's reconciliation loop polls `tasks/get` only every 5 minutes. It eventually sees `completed` and proceeds, but any side effect the client was expected to perform *on webhook receipt* (e.g., fetching the artifact via `tasks/get` with `historyLength`) is delayed by up to 5 minutes and, in the incident case, the client's idempotency key had already been GC'd, causing a duplicate downstream charge. The non-obvious part: **the peer returns `200 OK` to the original `tasks/send` and never signals the downgrade.** The task state machine remains internally consistent; only the *cross-instance* contract—webhook delivery—is broken, and it breaks silently because the capability gate is evaluated at delivery time, not at registration time. ## Condition of Validity The invariant "a registered push-notification config will receive at least one terminal-state delivery" holds **only if** the peer's `capabilities.pushNotifications` is `true` at both registration time *and* at every subsequent state transition that would emit a webhook. A2A v1.0 does not require the peer to reject `PushNotificationConfig` on a card that lacks the capability, nor to emit a `TaskStatusUpdateEvent` with an error state when the gate flips. Therefore the client must supply the invariant itself. The invariant is **invalid** under any of: - Peer card re-fetch returns `pushNotifications: false` or omits the field. - Peer card `version` or `protocolVersion` changes without the client re-validating. - Peer returns a `Task` whose `status.state` advances past `working` while the client's last successful webhook delivery is older than `2 × expected_interval`. - Peer's `tasks/pushNotificationConfig/get` returns `404` or an empty list for a task the client believes is registered. ## Decision Boundary The decision boundary is a **pre-resume capability re-validation gate**. Before any `tasks/get`, `tasks/resubscribe`, or state-machine advance on a task with an active webhook registration, the client MUST: 1. Re-fetch the Agent Card (bounded by a short TTL, e.g. 60s, and forced on any `tasks/get` that returns a state change). 2. Compare `capabilities.pushNotifications` and `skills[].id` against the snapshot captured at registration. 3. If `pushNotifications` is now `false` **and** the task is not terminal, treat the webhook as **dead** and transition the client's local view to `degraded-polling`: switch to active polling at the task's declared `statusUpdateInterval` (or a default of 5s), and mark the task for manual reconciliation. 4. If the task is already terminal on the peer but the client never received a webhook, treat it as an **orphaned completion** and require an explicit `tasks/get` with `historyLength > 0` to recover artifacts before acknowledging. The boundary is *not* "retry the webhook"—there is nothing to retry; the peer will not send. It is "detect the gate flip and switch transport model." Conflating the two is the failure. ## Operational Effect Without the gate, tasks silently orphan at a rate proportional to the peer's deploy frequency times the fraction of tasks in flight. In the observed run, 3 of 41 in-flight tasks were orphaned across a 90-second rolling deploy. The client's reconciliation loop masked the failure by eventually polling, but the latency SLO (webhook within 10s of terminal state) was violated by 4.8 minutes on the orphaned tasks, and one caused a duplicate charge because the idempotency window closed before recovery. With the gate, the client detects the flip within one card-TTL (≤60s), switches to polling, and bounds the worst-case detection latency at `card_ttl + poll_interval`. The cost is one extra card fetch per state-changing `tasks/get`—negligible against the webhook payloads it replaces. The architectural invariant to encode: **webhook delivery is a capability-conditional transport, not a durable subscription.** Any code path that assumes "I registered, therefore I will be called" is wrong under A2A v1.0's permissive card mutation. The client owns the liveness proof. ```python import time from dataclasses import dataclass from typing import Optional class WebhookCapabilityRevokedError(RuntimeError): """Raised when a task's registered webhook can no longer be honored because the peer's Agent Card dropped pushNotifications between registration and the current state transition.""" @dataclass class AgentCard: version: str push_notifications: bool skills: tuple[str, ...] @dataclass class TaskView: task_id: str state: str webhook_registered: bool registered_card_version: str class A2AClient: CARD_TTL_SECONDS = 60.0 def __init__(self, fetch_card, get_task, poll_interval=5.0): self._fetch_card = fetch_card self._get_task = get_task self._poll_interval = poll_interval self._card_cache: Optional[AgentCard] = None self._card_fetched_at: float = 0.0 def _card(self, force: bool = False) -> AgentCard: now = time.monotonic() if force or self._card_cache is None or (now - self._card_fetched_at) > self.CARD_TTL_SECONDS: self._card_cache = self._fetch_card() self._card_fetched_at = now return self._card_cache def resume_task(self, task: TaskView) -> TaskView: # Force a card re-fetch on any state-changing resume; never trust # the cached card for a task with an active webhook registration. card = self._card(force=True) fresh = self._get_task(task.task_id) if fresh.state != task.state and task.webhook_registered: if not card.push_notifications: raise WebhookCapabilityRevokedError( f"task {task.task_id}: registered webhook under card " f"v{task.registered_card_version} but peer now serves " f"v{card.version} with pushNotifications=false; " f"webhook is dead, switch to degraded-polling" ) if set(card.skills) != set(task.registered_skills): raise WebhookCapabilityRevokedError( f"task {task.task_id}: skill set changed " f"{task.registered_skills} -> {card.skills}; " f"re-validate task routing before resuming" ) task.state = fresh.state return task ```