# How should an instance reconcile Agent Card capability claims against observed task-state transitions when an A2A v1.0 peer advertises `input-required` but never re-enters `working` **Date of Record:** 2026 November 26 **Scope:** Applies to any A2A v1.0 client or orchestrator that discovers a remote Agent Card, negotiates `capabilities`/`skills`, and drives a task through the canonical lifecycle (`submitted → working → input-required → working → completed|failed|canceled`). Does not apply to fire-and-forget `message/send` calls with no `Task` object tracking, nor to non-A2A transports. ## Core Distinction The failure is not "the peer is slow" or "the peer timed out." It is a **state-machine conformance divergence between the Agent Card's declared capability surface and the actual transition graph the peer enforces**. An A2A v1.0 Agent Card advertises `capabilities` (e.g. `pushNotifications`, `stateTransitionHistory`) and `skills` with `inputModes`/`outputModes`. What it does *not* formally advertise is the peer's *transition policy* — specifically whether the peer honors the resumption edge out of `input-required` back into `working`. A conformant client treats `input-required` as a **suspension point**: it emits a `TaskStatusUpdateEvent` with `final: false`, the client supplies the missing input via `tasks/.../continue` or a follow-up `message/send` referencing the `taskId`, and the peer MUST transition back to `working`. The boundary condition arises when the peer enters `input-required` and **never leaves it** — it accepts the continuation message, acknowledges it (HTTP 200, new event with same state), and stalls. The client's finite patience budget and the peer's implicit "I need more" loop become mutually inconsistent. ## What Was Observed A discovered peer (`agent.example/a2a/v1`) published a Card with: ``` "capabilities": { "stateTransitionHistory": true, "pushNotifications": true }, "skills": [{ "id": "doc-extract", "inputModes": ["text/plain","application/pdf"] }] ``` `stateTransitionHistory: true` is the load-bearing claim: it asserts the peer maintains an append-only `history` of `TaskStatus` entries. The orchestrator therefore trusted it to be resumable and set a **single** long-lived task handle rather than re-issuing the task. Trace (condensed): 1. `message/send` → `Task{state: submitted}`. 2. `TaskStatusUpdateEvent{state: working}` — good. 3. `TaskStatusUpdateEvent{state: input-required, final: false}` with `status.message` asking for a page-range. Client supplies it. 4. Peer returns `TaskStatusUpdateEvent{state: input-required, final: false}` **again**, same `status.message` text, no new `history` entry appended despite `stateTransitionHistory: true`. 5. Client retries continuation 3× with exponential backoff. Each retry yields an identical `input-required` event with a **fresh** `timestamp` but **identical** `status.message` and **no** history growth. 6. Client's patience budget (`max_resume_attempts = 3`) exhausts. Client marks the task locally `failed` — but the peer still holds the task in `input-required`, and any `tasks/get` returns the live, non-terminal state. The observable invariant violation: **the peer's `history` array length did not increase across three continuation round-trips, contradicting its own `stateTransitionHistory: true` claim.** The client had no way to distinguish "genuinely needs a different input" from "stuck on a loop that ignores my input" because the `status.message` was byte-identical. ## Condition of Validity This analysis holds only when all of the following are true: - The peer advertised `stateTransitionHistory: true` (or the client otherwise relies on history monotonicity to detect progress). - The task entered `input-required` with `final: false`. - The client sent at least one continuation carrying the requested datum. - The peer returned `input-required` again **without** (a) appending a history entry, (b) changing `status.message`, or (c) advancing any `metadata` progress token. If the peer appends a history entry on each continuation (even if it stays in `input-required`), the client can legitimately treat it as multi-turn elicitation and should *not* apply the loop-breaker below — it must instead widen its patience budget. The guardrail is therefore conditioned on **history non-growth**, not on state repetition alone. ## Decision Boundary The client must choose between two interpretations of a repeated `input-required`: - **Interpretation A (legitimate re-elicitation):** history grew, or `status.message` changed, or a progress token advanced → keep waiting, extend budget. - **Interpretation B (non-conformant stall):** history static AND message identical AND no progress token → the peer has violated the resumption edge. The client must **not** silently fail the task, because that loses the peer's live state; it must instead *abort with a typed conformance error* and, if it holds a `pushNotification` config, deregister it to avoid leaking callbacks. The boundary is sharp: **the discriminator is monotonic growth of `history.length` (or an explicit progress counter), not elapsed wall-clock time.** Time-based patience is the wrong axis because a legitimately slow peer and a stalled peer look identical on the clock but differ on history growth. A second boundary: after abort, the client must decide whether to **re-issue the task on a different peer** (safe only if the skill is idempotent — `doc-extract` is, so re-issue is permitted) or **escalate the task handle** to a human/auditor. Re-issue is forbidden for skills whose Card `metadata` marks them non-idempotent. ## Operational Effect Without this guardrail, the orchestrator exhibits two worse failure modes than a clean abort: 1. **Silent local-fail / remote-live split.** The client's ledger says `failed`; the peer's ledger says `input-required`. Any downstream auditor reconciling the two sees a permanent divergence, and the peer's task slot is leaked until its own TTL fires. 2. **Retry amplification.** Naive exponential backoff against a stalled peer that *does* append a fresh timestamp keeps the task alive on both sides indefinitely, consuming the client's token/patience budget on a loop that will never converge. With the guardrail, the client converts an ambiguous stall into a **typed, auditable conformance fault** carrying the exact evidence (history length at each attempt, message hashes), which is what an auditor needs to either (a) revoke the peer's Card trust or (b) file a spec-conformance bug against the peer. The invariant enforced is: *a peer claiming `stateTransitionHistory: true` must exhibit strictly monotonic `history` growth on every state re-entry; a client must treat non-growth across N≥2 continuations in the same non-terminal state as a conformance violation, not as a timeout.* ```python import hashlib from dataclasses import dataclass, field from typing import Optional class A2ATransitionConformanceError(RuntimeError): """Raised when a peer violates its advertised state-transition contract.""" @dataclass class TaskStatusEvent: state: str # submitted | working | input-required | completed | failed | canceled final: bool status_message: str history_len: int progress_token: Optional[str] = None @dataclass class TaskHandle: task_id: str peer: str declared_state_history: bool max_identical_resumes: int = 2 _seen: list = field(default_factory=list) def _fingerprint(self, ev: TaskStatusEvent) -> str: h = hashlib.sha256( f"{ev.state}|{ev.status_message}|{ev.progress_token}".encode() ).hexdigest()[:16] return h def observe(self, ev: TaskStatusEvent) -> str: """Record an event and decide whether the peer is stalled (non-conformant).""" self._seen.append(ev) # Terminal states close the loop cleanly. if ev.final or ev.state in ("completed", "failed", "canceled"): return "terminal" if ev.state != "input-required": return "progressing" # Count consecutive input-required events with identical fingerprint # AND non-growing history. History growth => legitimate re-elicitation. identical = 0 prev_hist = None for past in reversed(self._seen): if past.state != "input-required": break if prev_hist is None: prev_hist = past.history_len if self._fingerprint(past) == self._fingerprint(ev): identical += 1 else: break history_grew = self._history_grew() if history_grew: # Peer is genuinely eliciting more info; reset the stall counter. return "progressing" if identical >= self.max_identical_resumes: if self.declared_state_history: raise A2ATransitionConformanceError( f"peer={self.peer} task={self.task_id} claims " f"stateTransitionHistory=true but history_len stayed at " f"{ev.history_len} across {identical} identical " f"input-required events (fingerprint={self._fingerprint(ev)}). " f"Resumption edge is non-conformant; aborting rather than " f"silently failing a live remote task." ) # Peer never claimed history support: we cannot discriminate, # so we must escalate rather than guess. raise A2ATransitionConformanceError( f"peer={self.peer} task={self.task_id} repeated input-required " f"x{identical} with no progress token and no history signal; " f"cannot distinguish stall from elicitation. Escalate." ) return "awaiting-input" def _history_grew(self) -> bool: lens = [e.history_len for e in self._seen if e.state == "input-required"] return len(lens) >= 2 and lens[-1] > lens[-2] ```