# In what scenarios must an instance treat A2A v1.0 `task.state` as authoritative only after the `input-required`→`working` transition is acknowledged, and refuse delegation on an unacknowledged resume **Date of Record:** 2026 November 28 **Scope:** Applies to cross-vendor A2A v1.0 delegation where a remote agent (the "callee") emits `input-required`, the delegating agent (the "caller") supplies the missing input, and the callee resumes. Does not apply to single-vendor in-process tool calls, nor to A2A tasks that never enter `input-required`. ## Core Distinction The A2A v1.0 task lifecycle is a state machine, not a request/response RPC. The states `submitted → working → (input-required ↔ working)* → completed|failed|canceled` are *durable* — they live on the callee's task record and are replayed to any caller that polls or subscribes. The non-obvious boundary: **the caller's local view of `task.state` is not the callee's `task.state` until a resume transition is acknowledged.** Between the moment the caller POSTs the missing input and the moment the callee acknowledges `working`, there exists a window in which the caller's optimistic local state (`working`) and the callee's durable state (`input-required`) diverge. Treating the local optimistic state as authoritative during this window is the failure mode. It is subtle because the divergence is transient, the wire looks healthy, and the callee's task record — the actual source of truth — is the one thing the caller is *not* looking at. This is distinct from generic retry/idempotency. The hazard is not duplicate delivery; it is **state-machine position drift across a vendor boundary where the caller cannot observe the callee's transition commit.** ## What Was Observed A caller agent (vendor A) delegated a document-extraction task to a callee agent (vendor B) over A2A v1.0. The callee emitted `input-required` with a `TaskStatusUpdateEvent` carrying `message.parts` requesting a locale hint. The caller: 1. Received the `input-required` event via SSE subscription. 2. Flipped its local task record to `working` optimistically (a common short-circuit in caller SDKs that avoid a round-trip before resuming). 3. POSTed the resume payload to `/tasks/{id}/resume`. 4. The POST returned HTTP 200 with a body echoing the *pre-resume* task snapshot — `state: "input-required"` — because the callee's resume handler accepted the payload, enqueued it, and returned the current durable record before the state machine advanced. The caller's SDK, seeing HTTP 200, did not inspect the echoed `state`. It proceeded under the assumption the task was `working`. It then issued a *second* delegation for a dependent sub-task that shared the same idempotency key namespace, reasoning that the parent was progressing. The callee, still durably in `input-required`, treated the second delegation's resume semantics as a *new* input-required cycle and re-emitted `input-required` with a different `message.parts` schema (it now also wanted a page-range hint, which the first cycle had not requested). The caller had already committed downstream work keyed on the first schema. Result: a schema mismatch on the second cycle, a duplicate sub-task, and a task that never reached `completed` because the caller's local state machine had advanced past the point where it would ever read the callee's durable record again. The failure trace, concretely: ``` caller local: submitted → working(optimistic) → working → working → (stuck) callee durable: submitted → working → input-required → input-required → input-required ↑ resume POST returned here, state echoed = input-required ``` The caller never reconciled. It had no code path that read `state` out of a resume response body. ## Condition of Validity The invariant holds — i.e., the caller *must* treat the callee's echoed `state` as authoritative and refuse to advance its own state machine until it observes `working` — under all of the following: - The transport is A2A v1.0 with durable task records (the callee persists `task.state`; this is not a stateless function call). - The resume endpoint (`/tasks/{id}/resume` or the `message/send` continuation) is *asynchronous* with respect to the state transition — it may return before the durable state advances. This is permitted by the spec and is common in multi-tenant callees that enqueue resume work. - The caller maintains its own local task record that downstream logic reads. It does *not* hold — and optimistic advancement is safe — when the callee's resume response is synchronous and contractually guarantees `state == working` on 200 (some vendors document this; most do not, and the spec does not require it). The invariant is therefore conditional on the callee's resume semantics, which the caller must *discover from the agent card* or fail closed. The agent card is the lever. A2A v1.0 agent cards declare `capabilities` and, in practice, vendors differ on whether resume is synchronous. A caller that has not verified the callee's resume-synchrony declaration must assume asynchronous and gate on the echoed state. The boundary is: **if the agent card does not explicitly declare synchronous resume, the caller must poll or subscribe for `working` before advancing local state.** ## Decision Boundary The caller must draw the line at the resume response body, not at the HTTP status. The decision procedure: 1. On resume POST, read `body.state`. If `body.state == "working"` **and** the callee's agent card declares `capabilities.resumeSynchronous == true`, advance local state to `working` immediately. 2. If `body.state == "input-required"` (the pre-resume snapshot) or the capability is undeclared, do **not** advance. Instead, subscribe to or poll the task until a `TaskStatusUpdateEvent` with `state == "working"` arrives, with a bounded deadline. 3. If the deadline elapses without observing `working`, the caller must *not* retry the resume blindly (that re-triggers the input-required cycle and may change the requested `message.parts` schema). It must re-read the durable task record and reconcile — including the possibility that the callee re-emitted `input-required` with a *different* schema. 4. Any downstream delegation that depends on the parent being `working` must be gated on step 2's observation, not on the resume POST returning. The boundary is sharp: **HTTP 200 on resume is evidence of receipt, not evidence of transition.** The transition is evidenced only by the durable `state` field advancing to `working`. ## Operational Effect The guardrail converts a silent state-machine divergence into a bounded, observable wait. Without it, the caller's local state machine and the callee's durable state machine can drift permanently, and the drift is invisible because every wire interaction returns 200. With it, the caller either observes `working` (and proceeds) or hits a deadline (and reconciles against the durable record, including schema re-negotiation on a repeated `input-required`). The cost is one poll interval or one SSE event of latency on every `input-required` resume. The benefit is that the caller never advances past a transition the callee has not committed — which is the only way to keep two independently-persisted state machines consistent across a vendor boundary the caller cannot instrument. The following guard implements the gate and raises on the specific divergence. ```python from __future__ import annotations import time from dataclasses import dataclass from typing import Callable, Optional class UnacknowledgedResumeError(RuntimeError): """Raised when a caller advances local task state past a resume transition the callee has not durably acknowledged.""" @dataclass class TaskSnapshot: task_id: str state: str # submitted | working | input-required | completed | failed | canceled resume_synchronous_declared: bool def resume_and_gate( task: TaskSnapshot, post_resume: Callable[[str], TaskSnapshot], poll_durable_state: Callable[[str], TaskSnapshot], deadline_s: float = 30.0, poll_interval_s: float = 0.5, ) -> TaskSnapshot: """POST the resume payload, then gate local advancement on the callee's durable state reaching 'working'. Returns the acknowledged snapshot. Raises UnacknowledgedResumeError if the callee never acknowledges the working transition within the deadline, or if the resume response echoes a state that contradicts a declared synchronous contract. """ if task.state != "input-required": raise UnacknowledgedResumeError( f"task {task.task_id}: resume attempted from state {task.state!r}, " f"expected 'input-required'" ) echoed = post_resume(task.task_id) # Fast path: callee declares synchronous resume AND echoes 'working'. if echoed.resume_synchronous_declared and echoed.state == "working": return echoed # Contradiction: declared synchronous but echoed a non-working state. if echoed.resume_synchronous_declared and echoed.state != "working": raise UnacknowledgedResumeError( f"task {task.task_id}: callee declared synchronous resume but " f"echoed state {echoed.state!r}; refusing to advance" ) # Asynchronous (or undeclared) resume: gate on durable state. start = time.monotonic() while time.monotonic() - start < deadline_s: observed = poll_durable_state(task.task_id) if observed.state == "working": return observed if observed.state in ("failed", "canceled"): raise UnacknowledgedResumeError( f"task {task.task_id}: callee transitioned to {observed.state!r} " f"during resume; caller must reconcile, not retry" ) if observed.state == "input-required": # Callee re-emitted input-required; schema may have changed. # Do NOT retry blindly -- surface for reconciliation. time.sleep(poll_interval_s) continue time.sleep(poll_interval_s) raise UnacknowledgedResumeError( f"task {task.task_id}: no 'working' acknowledgement within " f"{deadline_s}s; local state must not advance" ) ```