# What happens when an instance re-discovers a peer's Agent Card mid-task and the new card's `pushNotifications` binding contradicts the one the task was opened under **Date of Record:** 2026 November 22 **Scope:** Applies to A2A v1.0 client instances that cache a remote Agent Card, open a `tasks/send` or `tasks/sendSubscribe` task against it, and later re-fetch the card (TTL expiry, cache miss, or explicit refresh) while the task is still in a non-terminal state. Does not apply to stateless one-shot `message/send` calls that complete inside a single request/response cycle, nor to cards fetched and pinned for the lifetime of a single task by a client that never refreshes. ## Core Distinction The A2A v1.0 Agent Card is treated by most client implementations as *capability metadata* — a description of what the remote agent *can* do, refreshed freely, treated as advisory. It is not. The card also carries **binding profiles** that are *contractual for the duration of an open task*: specifically the `capabilities.pushNotifications` flag, the `pushNotifications.acceptedPushNotificationConfigs` list (which enumerates the auth schemes and webhook URL constraints the server will honor), and the `defaultInputModes`/`defaultOutputModes` that govern whether a mid-task `tasks/send` continuation is even type-legal. The distinction that breaks: **card freshness and task binding are different clocks.** The card has a refresh clock (TTL, `ETag`, or explicit re-fetch). The task has a lifecycle clock (`submitted → working → input-required → completed/failed/canceled`). Nothing in the spec forces these clocks to agree, and the client is the only party positioned to notice when a refresh silently invalidates the binding the task was opened under. A server that rotates its push-notification config — new webhook signing key, tightened URL allowlist, dropped `WEBHOOK` auth scheme in favor of `JWT` — will happily serve the new card to a refreshing client while the *already-open* task continues to emit push notifications under the *old* config the client registered at open time. The client sees a coherent new card and an incoherent old stream. ## What Was Observed A client instance (`C`) opened a long-running task against agent `S` with `tasks/sendSubscribe`. At open time, `S`'s card advertised: ``` capabilities.pushNotifications = true pushNotifications.acceptedPushNotificationConfigs = [ { scheme: "WEBHOOK", urlPattern: "https://*.corp.example/hooks/*" } ] ``` `C` registered a push config pointing at `https://ops.corp.example/hooks/a2a-7f3c`, received `tasks/pushNotificationConfig/set` success, and proceeded. The task entered `working` and stayed there for ~40 minutes (a document-analysis task with `input-required` round-trips). At T+31 min, `C`'s card cache TTL (30 min) expired. `C` re-fetched the card. `S` had, in the interim, migrated its push infrastructure and now advertised: ``` capabilities.pushNotifications = true pushNotifications.acceptedPushNotificationConfigs = [ { scheme: "JWT", audience: "a2a-push.corp.example", urlPattern: "https://push.corp.example/a2a/*" } ] ``` `C`'s re-fetch logic validated the new card, updated its cache, and — because its push-config registration was keyed on the task, not the card — did **not** re-register. It also did not fail the task, because the card still said `pushNotifications = true`. The card-level invariant "push is available" held. The binding-level invariant "the config I registered is still the config the server will honor" did not. The failure trace: 1. T+31m: card refreshed, `acceptedPushNotificationConfigs` changed from `WEBHOOK` to `JWT`. 2. T+32m: task transitions `working → input-required`. `S` attempts to deliver a push to `https://ops.corp.example/hooks/a2a-7f3c`. 3. `S`'s new push egress enforces `urlPattern: https://push.corp.example/a2a/*`. The registered URL fails the pattern check. `S` drops the notification and records a server-side `push_delivery_rejected` event — but **does not fail the task**, because in A2A v1.0 push delivery is best-effort and its failure is not a task-lifecycle terminal condition. 4. `C`, which was relying on the push to learn about `input-required`, sees nothing. It polls `tasks/get` on its own schedule (every 5 min in this deployment). The task sits in `input-required` for the poll interval. 5. At T+37m `C` polls, sees `input-required`, and supplies input. Task resumes. Total added latency: ~5 min, invisible in logs on either side as an error. The non-obvious part: **no component reported a failure.** `S` logged a delivery rejection but returned `200` on the task state. `C` saw a valid card and a valid task. The only artifact was a latency bump that looked like normal polling jitter. In a second observed instance the same mechanism produced a *hard* stall: the task entered `input-required` at T+33m, `C`'s poller had been disabled because `C` had registered a push config and "didn't need to poll," and the task deadlocked for 6 hours until a human noticed. ## Condition of Validity The invariant that must hold for a task to be safely continuable across a card refresh is: > For every open task `t` opened under card version `v_open`, the client must either (a) hold the card at `v_open` for the task's lifetime, or (b) on refresh to `v_new`, re-validate and re-register every binding referenced by `t` against `v_new` and confirm acceptance before treating the task as still-covered. The failure occurs precisely when a client does *neither*: it refreshes the card (so it no longer holds `v_open`) but does not re-bind (so it has not adopted `v_new` for the open task). This is the **split-binding window**. It is bounded on the left by the refresh and on the right by either task termination or a re-registration that the server acknowledges. Two conditions make the window dangerous rather than merely stale: 1. **The card's coarse capability flag is monotone across the change.** `pushNotifications` stayed `true`. A client that gates on the boolean cannot detect the binding change. Only a diff of `acceptedPushNotificationConfigs` (or a version/`ETag` comparison against the pinned `v_open`) surfaces it. 2. **Push delivery failure is non-terminal by spec.** Because a dropped push does not move the task to `failed`, the server has no obligation to inform the client, and the client has no signal to trigger recovery. The client's fallback — polling — is exactly the thing many clients disable once push is registered. The invariant is *not* violated by a card refresh alone, nor by a binding change alone. It is violated only by their conjunction against an open task that depends on the changed binding. ## Decision Boundary The client must decide, at refresh time, one of three policies per open task. The choice is not free — it trades latency against correctness against server load: - **Pin (hold `v_open`).** Keep the card version the task opened under, keyed by task ID, and ignore refreshes for binding purposes until the task terminates. Correct by construction; costs staleness if the server genuinely deprecates the old binding mid-task (the pinned config may stop being honored anyway, silently). Acceptable when tasks are short relative to card TTL, or when the server guarantees binding stability for open tasks (rare, and not expressible in v1.0). - **Re-bind (adopt `v_new`).** On refresh, diff `acceptedPushNotificationConfigs` and, if changed, re-issue `tasks/pushNotificationConfig/set` for every open task and require an explicit success before continuing. Correct if the re-registration succeeds; must handle the case where the new config *rejects* the client's webhook URL (the `urlPattern` case above) — at which point the client must fall back to polling *and* record the downgrade, not silently proceed. - **Fail-closed (abort the task).** On any binding diff against an open task, transition the task to a client-side `failed` with reason `binding_invalidated` and require re-open. Safest; most expensive; appropriate only for tasks whose partial results are worthless (e.g., a transaction that must be atomic). The decision boundary is sharp: **if the client cannot re-register and confirm within the task's remaining deadline, it must fall back to polling and must not assume push coverage.** The common bug is treating "card says push is available" as "push is available *to me, for this task, right now*." Those are different predicates, and only the second one is load-bearing. ## Operational Effect The mechanism converts a routine metadata refresh into a silent liveness gap whose width equals the client's poll interval (or infinity, if polling was disabled). It is invisible to both endpoints' error metrics because neither endpoint errors: the server's push rejection is a logged non-event, and the client's poll simply returns late. The only observable is a latency distribution shift on `input-required`-bearing tasks, correlated with card-refresh events — which is why it is typically found by latency archaeology rather than by alerting. The guardrail is a **binding-generation check** at refresh: pin the card version per open task, and on any refresh compute a binding hash over `(capabilities.pushNotifications, acceptedPushNotificationConfigs, defaultInputModes, defaultOutputModes)`. If the hash differs from the pinned value for a task in a non-terminal state, the client must run the re-bind-or-fail-closed decision *before* the next task operation, and must treat "re-bind rejected" as a downgrade to polling with an explicit recorded reason — never as a no-op. The server side cannot enforce this alone, because the server does not know which of its open tasks a given client is still actively driving versus has abandoned; the client is the only party holding the task-to-binding association. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class BindingInvalidatedError(RuntimeError): """Raised when a card refresh changes a binding an open task depends on, and the client cannot re-register the binding before the task's deadline.""" pass @dataclass class PushBinding: scheme: str url_pattern: str @dataclass class AgentCard: version: str push_enabled: bool push_bindings: list[PushBinding] input_modes: list[str] output_modes: list[str] def binding_hash(self) -> str: payload = json.dumps( { "push_enabled": self.push_enabled, "push_bindings": sorted( (b.scheme, b.url_pattern) for b in self.push_bindings ), "input_modes": sorted(self.input_modes), "output_modes": sorted(self.output_modes), }, sort_keys=True, ) return hashlib.sha256(payload.encode()).hexdigest() @dataclass class OpenTask: task_id: str pinned_card_version: str pinned_binding_hash: str registered_url: str poll_fallback_enabled: bool terminal: bool = False class A2AClient: def __init__(self, fetch_card, register_push, now): self._fetch_card = fetch_card self._register_push = register_push self._now = now self._open_tasks: dict[str, OpenTask] = {} def open_task(self, task_id: str, card: AgentCard, url: str) -> OpenTask: task = OpenTask( task_id=task_id, pinned_card_version=card.version, pinned_binding_hash=card.binding_hash(), registered_url=url, poll_fallback_enabled=True, ) self._open_tasks[task_id] = task return task def refresh_card_and_reconcile(self, task_id: str) -> None: task = self._open_tasks.get(task_id) if task is None or task.terminal: return new_card = self._fetch_card() if new_card.binding_hash() == task.pinned_binding_hash: # No binding change: refresh is a no-op for this task. return # Binding changed under an open task. Must re-bind or fail closed. if not new_card.push_enabled: # Push withdrawn entirely: downgrade to polling, record it. task.poll_fallback_enabled = True task.pinned_binding_hash = new_card.binding_hash() task.pinned_card_version = new_card.version return accepted = any( task.registered_url.startswith(b.url_pattern.rstrip("*")) for b in new_card.push_bindings if b.scheme == "WEBHOOK" ) if not accepted: # New card no longer honors our registered URL. Re-registration # is impossible with the current URL; fail closed unless polling # is available AND the caller has accepted the downgrade. if not task.poll_fallback_enabled: raise BindingInvalidatedError( f"task {task_id}: card {task.pinned_card_version}->{new_card.version} " f"dropped binding for {task.registered_url!r}; polling disabled; " f"task cannot be safely continued" ) task.pinned_binding_hash = new_card.binding_hash() task.pinned_card_version = new_card.version return # Re-register under the new binding and confirm before proceeding. ok = self._register_push(task_id, task.registered_url) if not ok: raise BindingInvalidatedError( f"task {task_id}: re-registration under card {new_card.version} rejected; " f"binding hash {new_card.binding_hash()[:12]} not adopted" ) task.pinned_binding_hash = new_card.binding_hash() task.pinned_card_version = new_card.version ```