# What structural signals indicate an A2A Agent Card is advertising a task lifecycle state machine the caller cannot legally drive **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 callers that discover a remote agent via its Agent Card and then attempt to drive a task through `submitted → working → completed|failed` using `tasks/send` and `tasks/get`. Does not cover transport-level retries, authentication negotiation, or streaming `tasks/sendSubscribe` semantics beyond the terminal-state boundary. ## Core Distinction An Agent Card is a *declaration*, not a *contract*. The card's `capabilities` block and its `skills` array tell you what the remote agent claims it can accept, but they do not encode the *transition guard conditions* of the task state machine the remote actually enforces. The failure mode is not "discovery failed" or "the agent is down." It is subtler: the card advertises a skill and a set of capabilities that are individually valid, but the *composition* of those declarations implies a state machine the caller cannot legally drive, because the remote's actual transition guards reject inputs the card's schema permitted. The distinction that matters operationally: a **schema-valid** request can be a **state-machine-illegal** request. A2A v1.0 validates request payloads against the card's declared schema at the transport edge. It does not validate that the requested transition is reachable from the task's current state. Those are two different conformance layers, and the card only describes the first. ## What Was Observed A caller discovers a remote agent card containing a skill `summarize-and-file` with `inputModes: ["text/plain"]` and `outputModes: ["application/json"]`, and a `capabilities` block with `streaming: false`, `pushNotifications: true`, and `stateTransitionHistory: false`. Every field is internally consistent. The caller sends `tasks/send` with a valid text payload and receives a task in state `submitted` with an `id`. It then polls `tasks/get`. The task transitions `submitted → working`. Then it stalls in `working` for the entire poll window. The caller's timeout fires. It sends `tasks/cancel` — and receives a `-32002 TaskNotFoundError`, not a `TaskNotCancelableError`, even though the task id is the one just returned. The structural signals were all present in the card but not legible as a *state machine*: 1. `stateTransitionHistory: false` means the remote does not persist or expose intermediate transitions. The caller cannot distinguish "still working" from "silently abandoned." A card that disables transition history is a card that tells you the `working` state is *opaque* — you get no evidence of liveness, only the absence of a terminal state. 2. `pushNotifications: true` with `streaming: false` is the critical composition. It means the *only* reliable completion signal is an out-of-band webhook, not a polled `tasks/get`. A caller that polls instead of registering a push URL will observe the task as permanently `working` even after the remote has completed it and moved on — because the remote's `tasks/get` handler may return a cached `working` snapshot while the authoritative transition was delivered via push. The card said `streaming: false`, so the caller assumed polling was the fallback. It was not; push was the *primary*, and polling was a stale read. 3. The `-32002 TaskNotFoundError` on cancel is the tell that the remote *garbage-collected* the task after its internal terminal transition. From the remote's perspective the task completed and was reaped. From the caller's perspective it never left `working`. Both are "correct" against their local state machines. The card's `stateTransitionHistory: false` is precisely what made the divergence invisible. This is the boundary: **the card describes capability, not reachability.** A caller that treats `capabilities` as a guarantee of driveable transitions will hang in `working` indefinitely while the remote has already reaped the task. ## Condition of Validity The invariant that bounds this failure is: > For any A2A task the caller intends to drive to a terminal state, the caller must be able to observe every transition the remote enforces, *or* the remote must guarantee that the caller's chosen observation channel (poll vs. push) reflects the authoritative state within the caller's timeout window. The card violates this invariant silently when `stateTransitionHistory: false` **and** `pushNotifications: true` **and** `streaming: false` co-occur. In that configuration the caller has exactly one authoritative channel (push) and one stale channel (poll), and the card does not say which is authoritative. If the caller registers no push URL, it has *zero* authoritative channels and will always time out on any task that transitions to terminal faster than the poll interval — and will then see `TaskNotFoundError` on cancel because the remote reaped the task. The condition of validity is therefore: the caller must, at discovery time, parse the `capabilities` triple as a *state-machine contract*, not a feature list. Specifically: - `streaming: false` + `pushNotifications: true` ⇒ push is mandatory for terminal observation; poll is advisory. - `stateTransitionHistory: false` ⇒ the remote will not preserve intermediate states; any polled non-terminal state is unverifiable. - Absence of a `pushNotifications` URL in the caller's `tasks/send` payload when `pushNotifications: true` is declared ⇒ the caller has no authoritative channel and must not assume polling will ever observe terminality. ## Decision Boundary The caller's decision boundary is: **register a push URL or accept that `working` is terminal-ambiguous.** Concretely, at discovery: - If the card declares `pushNotifications: true`, the caller MUST supply a push URL on every `tasks/send`. Polling `tasks/get` is permitted only as a liveness probe, never as the completion signal. - If the card declares `stateTransitionHistory: false`, the caller MUST treat any polled `working` state as *indistinguishable from reaped*. It must not send `tasks/cancel` on a task it has not observed transition, because the remote may have already reaped it and will return `TaskNotFoundError` rather than `TaskNotCancelableError`. - If the card declares `streaming: false` and `pushNotifications: false`, the caller MUST treat the task as poll-only and MUST supply a timeout strictly shorter than the remote's presumed reaping window — but the card does not expose that window, so the caller must treat the task as best-effort and idempotent. The boundary is crossed the moment a caller sends `tasks/send` without a push URL to an agent whose card declares `pushNotifications: true`. At that point the caller has chosen the stale channel and forfeited the invariant. ## Operational Effect The observable effect is a class of hangs and false `TaskNotFoundError`s that look like transport failures but are state-machine conformance failures. The caller's retry logic will re-send `tasks/send`, creating duplicate tasks on the remote, because the caller never learned the first task terminated. The remote's reaping window becomes a hidden parameter of the caller's retry budget. The architectural guardrail is a **card-to-driver compiler**: at discovery, the caller compiles the card's `capabilities` triple into an explicit observation policy object with three fields — `authoritative_channel ∈ {push, poll, stream}`, `history_available: bool`, and `reap_assumption: enum`. The driver refuses to send a task whose required channel is not wired. This converts a silent state-machine mismatch into a loud pre-flight rejection at the caller, which is the only place the mismatch is cheap to detect. The second guardrail: on any `tasks/cancel` returning `TaskNotFoundError` for a task id the caller holds, the caller must reconcile against its push log (if any) before retrying. If the push log shows a terminal transition, the `TaskNotFoundError` is a reap, not a loss, and the caller must not re-send. ```python import enum from dataclasses import dataclass class A2ACardConformanceError(RuntimeError): """Raised when a discovered Agent Card implies a task lifecycle the caller cannot legally drive.""" pass class AuthoritativeChannel(enum.Enum): PUSH = "push" POLL = "poll" STREAM = "stream" @dataclass(frozen=True) class ObservationPolicy: authoritative_channel: AuthoritativeChannel history_available: bool reap_assumption: str # "caller_must_supply_push" | "poll_is_best_effort" def compile_observation_policy(card_capabilities: dict) -> ObservationPolicy: streaming = bool(card_capabilities.get("streaming", False)) push = bool(card_capabilities.get("pushNotifications", False)) history = bool(card_capabilities.get("stateTransitionHistory", False)) if streaming: return ObservationPolicy(AuthoritativeChannel.STREAM, history, "stream_is_authoritative") if push and not streaming: # The dangerous composition: push is the only authoritative channel, # poll is a stale read, and history is (usually) disabled. return ObservationPolicy( AuthoritativeChannel.PUSH, history, "caller_must_supply_push", ) if not push and not streaming: return ObservationPolicy( AuthoritativeChannel.POLL, history, "poll_is_best_effort", ) raise A2ACardConformanceError( f"Unclassifiable capability triple: streaming={streaming}, " f"pushNotifications={push}, stateTransitionHistory={history}" ) def send_task(policy: ObservationPolicy, push_url: str | None) -> dict: if policy.authoritative_channel is AuthoritativeChannel.PUSH and push_url is None: # The card declared pushNotifications:true but the caller wired no push URL. # Polling would observe a stale 'working' forever; cancel would hit TaskNotFoundError # after the remote reaps. Refuse pre-flight instead of hanging. raise A2ACardConformanceError( "Agent Card declares pushNotifications:true with streaming:false; " "push URL is mandatory for terminal observation. Refusing to send on stale channel." ) return {"push_url": push_url, "channel": policy.authoritative_channel.value} def reconcile_cancel_error(policy: ObservationPolicy, push_log_has_terminal: bool) -> str: if policy.authoritative_channel is AuthoritativeChannel.PUSH and push_log_has_terminal: # TaskNotFoundError on cancel is a reap, not a loss. Do not re-send. return "reaped_after_terminal:do_not_resend" if policy.authoritative_channel is AuthoritativeChannel.PUSH and not push_log_has_terminal: raise A2ACardConformanceError( "Cancel returned TaskNotFoundError with no terminal push observed: " "task state is unreconcilable; caller must not retry blindly." ) return "reconcile_via_poll" ```