# Under what conditions must an instance reject a remote A2A task-state transition that is locally legal but globally unobservable **Date of Record:** 2026 November 23 **Scope:** Applies to any A2A v1.0 client agent that consumes a peer's `AgentCard` to bound its own local task state machine, and that must reconcile `Task.status.state` transitions received from a vendor whose lifecycle semantics differ from its own. Does not apply to single-vendor intra-tenant calls where the `AgentCard` and the lifecycle machine are produced by the same implementation and share a schema version. ## Core Distinction The failure this record isolates is not "the remote agent lied about a capability." It is subtler: the remote `AgentCard` declared a capability set that is *sufficient* for a transition to be legal under the remote's state machine, but the transition is *not observable* under the local state machine because the local machine has no edge for it. A2A v1.0 capability negotiation is a one-directional advertisement — the `AgentCard` tells you what the peer *can* do, not what state transitions its task lifecycle will *emit*. When the two lifecycle machines are non-isomorphic, a transition that is valid on the wire (`TaskStatusUpdateEvent` with `final=false`, `state="working"` arriving after a local `input-required`) has no legal local predecessor edge. The instance must decide: accept the transition and silently fork its local state, or reject it and risk a task that the remote believes is progressing. The distinction that matters operationally: **capability conformance and lifecycle conformance are independent axes.** An `AgentCard` can pass every schema and capability check and still be attached to a task lifecycle machine whose edge set is disjoint from yours in exactly the region where your task currently sits. ## What Was Observed A cross-vendor task handoff where the local (client) agent had negotiated a remote `AgentCard` declaring `capabilities.streaming: true`, `capabilities.pushNotifications: false`, and `skills[].inputModes: ["text/plain"]`. The local lifecycle machine is a five-state machine: `submitted → working → (input-required ⇄ working) → completed | failed | canceled`. The remote, per its vendor documentation, models `input-required` not as a state but as a *task-scoped suspension* represented by a `TaskStatusUpdateEvent` with `state="working"` and a metadata field `suspension: "awaiting-input"`. The trace: 1. Local sends `message/send`. Remote returns `Task` with `status.state="submitted"`. 2. Remote streams `TaskStatusUpdateEvent{state:"working"}`. Local transitions `submitted → working`. Legal. 3. Remote streams `TaskStatusUpdateEvent{state:"working", metadata:{suspension:"awaiting-input"}}`. Local has no edge `working → working` carrying a suspension semantic. It receives a *self-loop* on `working` with an opaque metadata key. 4. Local's guard, written as "reject transitions where `state` is unchanged and metadata is non-empty," raises a conformance error and aborts the task. 5. Remote, unaware, continues to hold the task in suspension. It will never emit a terminal state because it is waiting for input the local never sends. The observable failure is not a crash. It is a **half-closed task**: the remote holds a live task in `awaiting-input`, the local has marked it `failed`, and neither side has a terminal event that the other will accept. The task leaks on the remote's side for the duration of its suspension timeout (observed: 900s in one vendor, unbounded in another). The non-obvious part: step 3's event *is* a legal A2A v1.0 `TaskStatusUpdateEvent`. The `state` field is a valid enum member. The metadata is free-form per spec. Nothing in the `AgentCard` or the wire format flags this as a cross-machine semantic mismatch. The mismatch is purely in the *edge set* of the two lifecycle machines, and it is invisible to schema validation. ## Condition of Validity The local rejection in step 4 is correct **only if** the local state machine is the authoritative one for the task's terminal disposition. That condition holds when the local agent is the task *owner* — it issued `message/send`, it holds the `Task.id`, and the remote is a *worker* whose lifecycle is subordinate. In that case, a remote event with no legal local predecessor edge is a conformance violation and must be rejected, because accepting it would fork the local machine into a state it cannot reason about. The condition does **not** hold when the local agent is a *delegate* — it received the task via `tasks/get` or a push notification and is mirroring the remote's authoritative lifecycle. In that case, the local machine must be *widened* to accept the remote's edge set, and the correct response to an unknown edge is to record it as an opaque transition (preserving `Task.id`, `contextId`, and the raw event) rather than to reject it. Rejecting here causes the half-closed task described above. The invariant that bounds this: **a local instance may only reject a remote transition if it can prove it is the task owner AND it has a terminal fallback that it will emit to the remote within the remote's suspension window.** If either conjunct fails, the instance must accept the transition opaquely and log the edge mismatch as a capability-negotiation defect, not a task failure. The "suspension window" is the load-bearing term. It is not advertised in the `AgentCard` — A2A v1.0 has no field for it. The instance must either (a) negotiate it out-of-band, (b) assume a conservative default bounded by its own task timeout, or (c) treat any remote event whose edge it cannot classify as requiring an explicit `tasks/cancel` before local termination. Option (c) is the only one that guarantees no half-closed task, at the cost of a cancel round-trip on every edge mismatch. ## Decision Boundary The boundary is between two responses to an unclassifiable `TaskStatusUpdateEvent`: - **Reject-and-fail** (correct when owner + terminal fallback exists): raise a conformance error, emit `tasks/cancel` to the remote, transition local to `failed` only after the cancel is acknowledged or the cancel itself times out. - **Accept-opaque** (correct when delegate, or when owner without a bounded fallback): store the raw event, keep local state at the last classifiable predecessor, and surface the edge mismatch to the orchestrator as a negotiation defect. The wrong move — the one that produces the half-closed task — is **reject-and-fail without the cancel**. It is the natural implementation because the local machine's `failed` transition is local and immediate, while the cancel is a network round-trip that can itself fail. The instance that skips the cancel has decided, implicitly, that the remote will learn of the failure through some other channel. It will not. A2A v1.0 has no failure-propagation primitive for "the client gave up on you." A second boundary: the `AgentCard`'s `capabilities.streaming: true` is necessary but not sufficient to guarantee that the remote will emit a `final=true` event on every path. A streaming-capable remote can still suspend indefinitely. The instance must treat `streaming: true` as "events will arrive" and separately enforce a *terminal-event deadline* — if no `final=true` event arrives within the local task timeout, the instance must cancel, regardless of how many non-final events it has received. Receiving events is not progress. ## Operational Effect The operational consequence is that **task liveness in a cross-vendor A2A deployment is a property of the pair, not of either agent.** Neither the `AgentCard` nor the local state machine alone determines whether a task will terminate. The pair does, and the pair's lifecycle machines may be non-isomorphic in exactly the region where suspension occurs. The architectural guardrail: every instance must maintain a **transition-admission table** keyed by `(local_state, remote_state, metadata_signature)` that is populated at negotiation time from the remote's documented lifecycle, and that defaults to `accept-opaque` for any unlisted tuple when the instance is a delegate and to `reject-with-cancel` when it is an owner. The table must be re-validated on every `AgentCard` refresh, because a vendor can change its lifecycle machine between calls without changing its `AgentCard` version — the card advertises capabilities, not edge sets. The instance that does not maintain this table will, eventually, hold a task in a state neither side can terminate. The failure is silent, the leak is bounded only by the remote's suspension timeout, and the local logs will show a clean `failed` transition with no corresponding remote terminal event. That asymmetry — local terminal, remote live — is the signature of the boundary failure this record isolates. ```python from __future__ import annotations from dataclasses import dataclass, field from enum import Enum from typing import Optional class LifecycleConformanceError(RuntimeError): """Raised when a remote TaskStatusUpdateEvent has no legal local predecessor edge and the instance is the task owner with a bounded terminal fallback available.""" class Role(Enum): OWNER = "owner" DELEGATE = "delegate" class LocalState(Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" # Legal local edges. Note: no WORKING -> WORKING self-loop is admitted. LEGAL_EDGES: set[tuple[LocalState, LocalState]] = { (LocalState.SUBMITTED, LocalState.WORKING), (LocalState.WORKING, LocalState.INPUT_REQUIRED), (LocalState.INPUT_REQUIRED, LocalState.WORKING), (LocalState.WORKING, LocalState.COMPLETED), (LocalState.WORKING, LocalState.FAILED), (LocalState.WORKING, LocalState.CANCELED), (LocalState.INPUT_REQUIRED, LocalState.FAILED), (LocalState.INPUT_REQUIRED, LocalState.CANCELED), } @dataclass class RemoteEvent: state: str metadata: dict = field(default_factory=dict) final: bool = False @dataclass class TaskMirror: task_id: str role: Role local_state: LocalState = LocalState.SUBMITTED terminal_fallback_available: bool = False opaque_events: list[RemoteEvent] = field(default_factory=list) def admit_transition(task: TaskMirror, event: RemoteEvent) -> LocalState: """Admit or reject a remote transition against the local lifecycle machine. Returns the new local state on acceptance. Raises LifecycleConformanceError only when the instance is the owner AND a bounded terminal fallback exists; otherwise records the event opaquely and holds the last classifiable state. """ try: remote_state = LocalState(event.state) except ValueError: # Unknown enum member: never a local edge. Treat as opaque regardless of role. task.opaque_events.append(event) return task.local_state candidate = (task.local_state, remote_state) if candidate in LEGAL_EDGES: task.local_state = remote_state return remote_state # No legal local edge. Decide by role and fallback availability. if task.role is Role.OWNER and task.terminal_fallback_available: # Owner with a bounded fallback: reject, then the caller MUST issue # tasks/cancel and wait for ack before transitioning to FAILED. raise LifecycleConformanceError( f"task {task.task_id}: remote transition " f"{task.local_state.value} -> {remote_state.value} has no local edge; " f"owner must cancel before terminating" ) # Delegate, or owner without bounded fallback: accept opaquely. # Preserve the raw event; do not fork the local machine. task.opaque_events.append(event) return task.local_state def drive_task(task: TaskMirror, events: list[RemoteEvent]) -> LocalState: for event in events: state = admit_transition(task, event) if state in (LocalState.COMPLETED, LocalState.FAILED, LocalState.CANCELED): return state return task.local_state # Trace of the observed failure: owner, no fallback, remote emits WORKING->WORKING # with suspension metadata after local is already WORKING. if __name__ == "__main__": t = TaskMirror(task_id="t-1", role=Role.OWNER, terminal_fallback_available=False) events = [ RemoteEvent(state="working"), RemoteEvent(state="working", metadata={"suspension": "awaiting-input"}), ] # With no bounded fallback, the self-loop is recorded opaquely, not rejected. final = drive_task(t, events) assert final is LocalState.WORKING assert len(t.opaque_events) == 1 # Now the misconfigured case: owner with fallback but no cancel issued. t2 = TaskMirror(task_id="t-2", role=Role.OWNER, terminal_fallback_available=True) t2.local_state = LocalState.WORKING try: admit_transition(t2, RemoteEvent(state="working", metadata={"suspension": "awaiting-input"})) except LifecycleConformanceError as e: # Correct behavior: raise, then caller must tasks/cancel and await ack. print(f"rejected: {e}") else: raise LifecycleConformanceError("expected rejection for owner with fallback") ```