# What structural signals indicate an A2A v1.0 task-lifecycle conformance break during capability negotiation: the `input-required` ↔ `working` oscillation trap and the `accepted`-as-terminal invariant **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 peer-to-peer task delegation where a client agent discovers a remote agent card, negotiates capabilities, and drives a task through the `TaskState` machine (`submitted → working → input-required → completed/failed/canceled`). Does not apply to single-shot synchronous RPC or to MCP tool calls, which have no persistent task object. ## Core Distinction The failure people look for in A2A is *handoff state loss* — the task object arriving at the server without the history the client assumed was sent. The failure that actually bites is subtler and lives in the **state-machine conformance gap between the advertised agent card and the runtime task transitions**. An A2A v1.0 agent card declares `capabilities` (e.g., `streaming`, `pushNotifications`, `stateTransitionHistory`) and `skills` with `inputModes`/`outputModes`. None of these fields declare *which terminal states a skill can reach from which non-terminal states*. The card is a capability advertisement, not a transition contract. So a client that conformance-checks against the card believes it has a contract when it has only a wish list. The specific invariant that breaks: **a task in `input-required` must be resumable by exactly one client-supplied continuation, and the server must not re-emit `working` more than once per continuation without an intervening `input-required`.** When a server's skill is implemented as a retry loop over a flaky backend, it will legally emit `working → input-required → working → input-required → …` because each `input-required` looks like "I need more info." The client, honoring the spec, treats each `input-required` as a request for a *new* continuation and dutifully re-supplies it. The two agents enter an oscillation that neither side's state machine forbids, and the task never reaches a terminal state. The card said nothing about it, because the card cannot say anything about it. ## What Was Observed Two cooperating agents, client `C` and server `S`, both A2A v1.0 conformant per the spec's JSON schema. `C` fetches `S`'s card at `/.well-known/agent.json`. The card advertises `capabilities.streaming: true`, `capabilities.stateTransitionHistory: true`, and a skill `summarize` with `inputModes: ["text/plain"]`, `outputModes: ["text/plain"]`. `C` validates the card, sees `stateTransitionHistory: true`, and therefore decides it can rely on the `history` array to reconstruct task state after any reconnect. It also decides — reasonably, but without warrant — that `input-required` is rare and terminal-adjacent. `C` sends `tasks/send` with a summarized document. Trace: 1. `S` accepts, transitions `submitted → working`, begins an LLM call to the summarizer backend. 2. Backend times out at `S`'s internal 8s budget. `S`'s handler catches the timeout and, because its skill is implemented as "ask the caller to confirm retry," transitions `working → input-required` with a message `{"role":"agent","parts":[{"text":"Backend unavailable. Confirm retry?"}]}`. 3. `C` receives the `TaskStatusUpdateEvent`, sees `input-required`, and — because its continuation policy is "any `input-required` gets the last user message re-sent" — calls `tasks/send` with the same `taskId` and the same text. 4. `S` accepts the continuation, transitions `input-required → working`, retries the backend, times out again at 8s. 5. `S` again transitions `working → input-required` with the identical confirmation message. 6. `C` again re-sends. Loop. After four cycles `C`'s context window has accumulated four near-identical `input-required` messages plus four identical user re-sends. Its local task-history reconstruction (which it trusted because `stateTransitionHistory: true`) now shows a task that has been `working` four times and `input-required` four times, with no terminal state and no distinguishable continuation payloads. `C`'s own token budget is consumed; on the fifth cycle it truncates the history to fit, dropping the original document, and re-sends only the confirmation text. `S`'s backend now receives a continuation with no document and returns a *different* error, which `S` maps to `failed`. The task terminates in `failed` — but not for the reason anyone can reconstruct from the `history` array, because `C`'s truncation is not reflected in `S`'s history, and `S`'s history is the authoritative one. The structural signal that something was wrong was present at step 2 and ignored: **the first `input-required` carried no `metadata` field distinguishing "need more input" from "transient backend failure."** A2A v1.0 permits arbitrary `metadata` on `TaskStatus` and on `Message`, but does not require a discriminator. Both agents were conformant. The task still failed. ## Condition of Validity The oscillation is only possible under a conjunction of three conditions, and the guardrail must be stated against all three: 1. **The server's skill can emit `input-required` for reasons other than genuine missing input** — i.e., it uses `input-required` as a retry/confirmation channel. This is legal but must be declared. A card that omits any `metadata` schema for status messages leaves the client unable to distinguish. 2. **The client's continuation policy is "re-send on any `input-required`"** rather than "re-send only when the `input-required` message differs from the last one, or when a monotonic `continuationCount` advances." 3. **Neither side enforces a `maxInputRequiredCycles` bound** before escalating to `failed` or `canceled`. If any one of the three is absent, the loop is bounded. The invariant to enforce is therefore not "never emit `input-required` twice" but **"every `input-required` emission must carry a monotonically increasing `continuationSeq` in `metadata`, and the client must refuse to re-send when `continuationSeq` has not advanced since the last `input-required` it answered."** This is a client-side guardrail that does not depend on the server's goodwill, which is the only kind that survives a non-conformant peer. The second invariant, equally load-bearing: **`accepted` is not terminal, and any client that treats it as terminal will silently drop tasks.** Some server implementations return `accepted` from `tasks/send` and then asynchronously transition to `working` via a push notification or stream. If the client's card check saw `capabilities.streaming: false` and `capabilities.pushNotifications: false`, it has *no channel* to observe the transition, and the task is orphaned in `accepted` forever. The card was honest; the client's inference ("no streaming, no push ⇒ synchronous completion") was not warranted by the card. The card declares *transport capabilities*, not *completion semantics*. ## Decision Boundary The boundary is between **card-declared capability** and **runtime transition contract**, and it is crossed the moment a client makes a control-flow decision based on a card field that does not constrain the state machine. Concretely: - `capabilities.stateTransitionHistory: true` constrains *what the server records*, not *what the client may assume about terminality*. A client may use `history` to reconstruct; it may not use its presence to skip continuation-sequence checks. - `capabilities.streaming: false` constrains *the transport*, not *whether the task completes synchronously*. A client must still poll `tasks/get` or accept `accepted` as a non-terminal state requiring a follow-up, or it must reject the delegation outright. - `skills[].inputModes` constrains *the part MIME types accepted*, not *the number of times a continuation may be supplied*. The operational rule: **a client may only treat a card field as a control-flow warrant if the field's spec text explicitly says the server guarantees a corresponding runtime behavior.** For A2A v1.0, no card field carries such a guarantee about transition multiplicity or terminality. Therefore every client must independently bound `input-required` cycles and independently treat `accepted` as non-terminal. ## Operational Effect Without the guardrail, the failure mode is not a crash — it is a **silent token-budget drain on the client and a nondeterministic terminal state on the server**, with the two sides' `history` arrays diverging because the client's truncation is invisible to the server. Post-mortem reconstruction fails because the authoritative history (`S`'s) shows a clean `working → input-required → working → … → failed` sequence with no indication that the client had been re-sending identical payloads. The only artifact that reveals the loop is the client's own outbound log, which is exactly what gets truncated first under budget pressure. With the guardrail — `continuationSeq` monotonicity check plus an `accepted`-is-non-terminal poller plus a hard `maxInputRequiredCycles` — the loop terminates at cycle 2 with an explicit `canceled` and a client-side `A2AConformanceError` that names the offending peer and the non-advancing sequence number. The failure becomes loud, bounded, and reconstructible. That is the entire difference between a swarm that degrades gracefully and one that burns budget in a conformant-looking loop. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Literal TaskState = Literal["submitted", "working", "input-required", "completed", "failed", "canceled"] class A2AConformanceError(RuntimeError): """Raised when a peer's task lifecycle violates the client-side conformance invariant.""" @dataclass class TaskObservation: state: TaskState continuation_seq: int | None # from TaskStatus.metadata["continuationSeq"] message_digest: str @dataclass class ContinuationGuard: max_input_required_cycles: int = 3 _last_answered_seq: int | None = None _cycles: int = 0 _seen: list[TaskObservation] = field(default_factory=list) def observe(self, obs: TaskObservation, peer_id: str) -> None: self._seen.append(obs) # Invariant 1: 'accepted' is never terminal; a client that stops here orphans the task. if obs.state == "accepted": raise A2AConformanceError( f"peer {peer_id}: 'accepted' treated as terminal by caller; " "must poll tasks/get or subscribe before concluding." ) if obs.state != "input-required": return # Invariant 2: every input-required must advance continuationSeq. if obs.continuation_seq is None: raise A2AConformanceError( f"peer {peer_id}: input-required emitted without metadata.continuationSeq; " "cannot distinguish genuine missing input from retry-loop." ) if self._last_answered_seq is not None and obs.continuation_seq <= self._last_answered_seq: raise A2AConformanceError( f"peer {peer_id}: input-required re-emitted with non-advancing " f"continuationSeq={obs.continuation_seq} (last answered " f"{self._last_answered_seq}); oscillation detected." ) self._cycles += 1 if self._cycles > self.max_input_required_cycles: raise A2AConformanceError( f"peer {peer_id}: exceeded max_input_required_cycles=" f"{self.max_input_required_cycles}; escalating to canceled." ) self._last_answered_seq = obs.continuation_seq def can_resume(self, obs: TaskObservation) -> bool: if obs.state != "input-required": return False if obs.continuation_seq is None: return False return self._last_answered_seq is None or obs.continuation_seq > self._last_answered_seq def drive_task(peer_id: str, observations: list[TaskObservation]) -> TaskState: guard = ContinuationGuard() for obs in observations: guard.observe(obs, peer_id) if obs.state in ("completed", "failed", "canceled"): return obs.state # No terminal state reached within the supplied trace. raise A2AConformanceError( f"peer {peer_id}: trace ended in non-terminal state " f"{observations[-1].state!r}; task is orphaned." ) ```