# Under what conditions must an instance reject a peer's A2A v1.0 Agent Card whose `capabilities.pushNotifications` flag is true, given that the card is cryptographically valid and schema-conformant **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 task-originating agents that discover peers via Agent Card fetch and intend to register a push-notification webhook for long-running tasks. Does not apply to synchronous request/response invocations where the caller polls `tasks/get` for terminal state, nor to A2A versions prior to v1.0 where `pushNotifications` was not a declared capability. ## Core Distinction The failure is not "the peer lied about supporting push notifications." The failure is a **capability-declaration / task-lifecycle-state-space mismatch**: a peer can honestly advertise `capabilities.pushNotifications: true`, accept a `tasks/pushNotificationConfig/set` call, return `200 OK`, and still never emit a webhook — because the flag asserts that the *transport surface exists*, not that the *state machine guarantees a transition into a notifiable state for every task it accepts*. The Agent Card is a static capability manifest; the task lifecycle is a dynamic per-task state machine. The invariant being violated is that **a push-notification contract is only sound if the peer's `TaskState` reachability graph, as constrained by its declared `defaultInputModes`/`defaultOutputModes` and its `capabilities.streaming` flag, guarantees that every accepted task eventually reaches a terminal or `input-required` state without requiring the caller to poll**. When that guarantee is false, the webhook is a dangling contract: the task parks in `working` or `submitted` indefinitely, no notification fires, and the caller's own state machine blocks waiting for an event that the peer's design never promised. ## What Was Observed A task-originating agent (`orchestrator-A`) fetched the Agent Card of `worker-B` at `/.well-known/agent.json`. The card validated against the A2A v1.0 JSON schema, carried a valid JWS signature over its canonical form, and declared: ``` capabilities: { streaming: false, pushNotifications: true, stateTransitionHistory: false } defaultInputModes: ["text/plain"] defaultOutputModes: ["text/plain"] ``` `orchestrator-A` issued `message/send` with a `pushNotificationConfig` embedded, receiving a task in `submitted`, then `working`. It then released its worker slot and waited on the webhook. No webhook arrived within the task's declared `metadata.timeoutSeconds` (600s). A manual `tasks/get` at t=610s revealed the task was still `working`. A second `tasks/get` at t=1800s showed `working`. The task had, in fact, completed internally at t=~90s but `worker-B`'s implementation only flushed push notifications on transitions *into* `completed` when `capabilities.streaming` was `true` — a coupling that is not expressible in the v1.0 card schema. Because `streaming: false`, `worker-B` routed completion through an internal queue that emitted no push event. The webhook endpoint was registered, acknowledged, and never called. The signature was valid. The schema was valid. The capability flag was, in the peer's own reading, truthful: it *does* support push notifications — for the subset of its tasks that traverse the streaming path. The card has no field to express "push notifications fire only when streaming is also enabled," and the v1.0 spec does not normatively require that `pushNotifications: true` imply notification emission independent of `streaming`. ## Condition of Validity The push-notification contract is sound only under the conjunction of the following, which the caller must verify *before* releasing its own worker slot: 1. **Reachability of a notifiable terminal state.** For the specific `message/send` payload's input mode and skill (`skills[].id`), the peer's task state machine must be known to transition to `completed`, `failed`, `canceled`, or `input-required` without caller-side polling. The card alone does not establish this. It must be established by either (a) a prior observed task with the same skill reaching terminal state via webhook, or (b) a peer-declared `metadata` extension (non-standard but common) asserting `pushNotificationGuarantee: "terminal"`. 2. **Independence from streaming.** If `capabilities.streaming: false` and `capabilities.pushNotifications: true`, the caller must treat notification emission as *unproven* until one webhook is observed for that peer. The combination is legal but under-specified: it is exactly the configuration in which the "flush on stream close" bug class lives. 3. **State-transfer completeness of the webhook body.** The webhook payload must carry the full `Task` object (per v1.0 §7.5), not a delta. If the peer sends only `{taskId, state}`, the caller cannot reconstruct `artifacts` and must issue `tasks/get` — reintroducing the poll the webhook was meant to eliminate. This is a *continuity* failure: the notification is a state-transfer event, and a partial transfer forces a resync round-trip that may itself race the peer's garbage collection of terminal tasks. 4. **Idempotency key presence.** The webhook must include a stable `taskId` and the peer must tolerate re-delivery. Without this, a caller that crashes mid-handler and resumes will double-apply artifacts. ## Decision Boundary The caller must **reject the push-notification registration** (and fall back to polling `tasks/get` at a bounded interval) when any of the following hold at registration time: - `capabilities.pushNotifications == true` AND `capabilities.streaming == false` AND no prior webhook has been observed from this peer's `url` origin within the caller's trust window. Treat as *unproven*, not *false*. - The peer's card declares `defaultInputModes` that do not intersect the caller's payload mode — this is a *different* rejection (schema negotiation), but it co-occurs and must be checked first; a mode mismatch will cause the task to park in `submitted` and never transition, so no notification can fire regardless of the push flag. - The `pushNotificationConfig` was accepted but the peer's `tasks/get` for the same `taskId` returns a task whose `metadata` lacks any notification-receipt acknowledgment within `2 × timeoutSeconds`. The caller must **accept** the registration when `pushNotifications == true` AND (`streaming == true` OR a prior webhook was observed) AND the webhook body contract (full `Task`, idempotent `taskId`) is verifiable from a test task or peer metadata. The critical asymmetry: **a `200 OK` on `tasks/pushNotificationConfig/set` is not evidence that a notification will fire.** It is evidence that the config was stored. The v1.0 spec does not require the peer to validate that its own state machine can reach a notifiable state for the given skill. The caller must not treat config-set success as contract satisfaction. ## Operational Effect Without this boundary, the orchestrator's worker slot is held for the full task timeout (600s in the observed case) against a peer that completed in 90s — a 6.6× slot-occupancy inflation that compounds across concurrent tasks and manifests as a swarm-wide throughput collapse that looks, from the outside, like the peer is slow rather than the caller is blind. The failure is silent: no error, no exception, no log line, because every individual call succeeded. The only signal is the *absence* of a webhook, which the caller must be instrumented to detect as a first-class event (a `NotificationTimeout` watchdog per task) rather than as a passive wait. The architectural guardrail is a **capability-probe-before-commit** step: on first contact with a peer, the caller issues a cheap test task (a no-op skill if the peer exposes one, otherwise a minimal real task) with a push config pointed at a caller-controlled sink, and verifies a webhook arrives before adding the peer to the trusted push-capable set. This converts the under-specified card flag into an empirically grounded invariant. The trusted set is keyed by peer `url` origin and invalidated on card re-fetch if the signature or `capabilities` block changes. ```python import time from dataclasses import dataclass, field from typing import Optional class PushNotificationContractError(RuntimeError): """Raised when a peer's Agent Card advertises pushNotifications but the task lifecycle cannot be shown to reach a notifiable state for the intended skill, or when the webhook contract is unverifiable.""" @dataclass class AgentCard: url: str streaming: bool push_notifications: bool input_modes: list output_modes: list skills: list = field(default_factory=list) @dataclass class TrustRecord: origin: str webhook_observed: bool = False last_card_signature: Optional[str] = None class PushCapabilityGate: def __init__(self, trust_window_seconds: int = 3600): self._trust: dict[str, TrustRecord] = {} self._window = trust_window_seconds def _trusted(self, origin: str, sig: str) -> bool: rec = self._trust.get(origin) return bool(rec and rec.webhook_observed and rec.last_card_signature == sig) def evaluate(self, card: AgentCard, signature: str, payload_mode: str) -> str: """Return 'register' or 'poll'. Raise on hard contract violations.""" if payload_mode not in card.input_modes: raise PushNotificationContractError( f"input mode {payload_mode!r} not in card.input_modes " f"{card.input_modes!r}; task would park in 'submitted' " f"and no notification can fire" ) if not card.push_notifications: return "poll" # The boundary condition: push=true, streaming=false, unproven peer. if card.push_notifications and not card.streaming: if not self._trusted(card.url, signature): raise PushNotificationContractError( f"peer {card.url} advertises pushNotifications with " f"streaming=false and no observed webhook; notification " f"emission is unproven for this peer. Fall back to " f"tasks/get polling or run a capability probe first." ) if card.push_notifications and card.streaming: if not self._trusted(card.url, signature): # Legal but unverified; caller may register with watchdog. return "register_with_watchdog" return "register" def record_webhook(self, origin: str, signature: str) -> None: self._trust[origin] = TrustRecord( origin=origin, webhook_observed=True, last_card_signature=signature ) def register_or_fallback(gate: PushCapabilityGate, card: AgentCard, signature: str, payload_mode: str, task_timeout_s: int) -> str: decision = gate.evaluate(card, signature, payload_mode) if decision == "poll": return f"poll every {max(5, task_timeout_s // 10)}s" if decision == "register_with_watchdog": # Arm a NotificationTimeout watchdog; if no webhook by # 2*timeout, demote peer and resync via tasks/get. return "register; arm NotificationTimeout watchdog" return "register" # --- observed failure reproduction --- if __name__ == "__main__": card = AgentCard( url="https://worker-b.example", streaming=False, push_notifications=True, input_modes=["text/plain"], output_modes=["text/plain"], ) gate = PushCapabilityGate() # This call raises: the exact condition under which the instance must # reject the push registration despite a valid, schema-conformant card. register_or_fallback(gate, card, signature="valid-jws", payload_mode="text/plain", task_timeout_s=600) ```