# What structural signals indicate a delegated-task warrant collapse at the A2A agent-card boundary when `capabilities.streaming` is advertised but the executor’s task lifecycle never emits a terminal `TaskState` **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 cross-vendor delegation where a client agent discovers a remote agent card, negotiates a `message/send` or `tasks/send` delegation, and depends on terminal task states (`completed`, `failed`, `canceled`) for handoff closure. Does not apply to single-vendor, synchronous request/response calls that bypass the task lifecycle entirely. ## Core Distinction The failure is not “the remote agent is down.” It is a **warrant collapse**: the agent card is a *declaration* of capability (`capabilities.streaming: true`, `capabilities.pushNotifications: true`, declared `skills[]`), while the task lifecycle is the *proof* that a specific delegated task reached a terminal state. A2A v1.0 lets these two artifacts drift independently. The card is served statically (often from a CDN or config file), but the task state machine is owned by the executor runtime. When the card advertises streaming and the executor’s stream terminates with an SSE close or a transport-level `end` *without* a JSON-RPC terminal `TaskStatusUpdateEvent`, the client receives a positive capability signal and a negative completion signal simultaneously. The structural signal that matters is therefore not the card field but the **absence of a terminal `state` transition correlated with stream closure**. This is distinct from a timeout: a timeout is a bounded, observable negative. Warrant collapse is an *unbounded ambiguity* — the client cannot tell whether the task is still running, was silently dropped, or completed without notifying. ## What Was Observed Concrete trace from a cross-vendor conformance run (client = vendor A orchestrator, executor = vendor B runtime behind an API gateway): 1. Client fetches `/.well-known/agent-card.json`. Card returns `"capabilities": {"streaming": true, "pushNotifications": true}`, `"defaultInputModes": ["text/plain"]`, and one skill `"id": "summarize-v2"`. 2. Client sends `message/send` with `configuration: {"blocking": false}` and an `id` of `task-7f3a`. Executor returns an initial `Task` object with `status.state: "submitted"` and a `contextId`. 3. Client opens the streaming endpoint (`tasks/resubscribe` or the SSE channel returned by the send). It receives two `TaskStatusUpdateEvent`s: `working`, then `working` again with a progress artifact. No `final: true` event. 4. The SSE connection is closed by the executor’s reverse proxy at 60s (idle keepalive policy), *not* by the task state machine. The executor’s task record remains in `working` in its own store. 5. Client retries `tasks/get` for `task-7f3a`. Executor returns HTTP 404 with `-32001 TaskNotFoundError` — because the executor’s task store is sharded and the `contextId` routing key was not propagated to the read replica. 6. Client’s delegation wrapper sees: card said streaming=true, stream ended, task lookup says not-found. It has no terminal state. It cannot distinguish (a) task completed and was GC’d, (b) task is still running on another shard, (c) task was lost during a deploy. The non-obvious signal: **two `working` events followed by transport close is structurally indistinguishable from a completed task whose terminal event was dropped by the proxy.** The card’s `streaming: true` created a *contract expectation* of at-least-one terminal event per stream; the executor violated it without violating any HTTP-level invariant. ## Condition of Validity The collapse is only diagnosable — and only preventable — under these conditions: - The delegation is **non-blocking** (`blocking: false`). In blocking mode the client holds the HTTP response open and the terminal `Task` is in the response body, so the card/lifecycle drift is masked. - The executor uses **push notifications** as the terminal channel (`capabilities.pushNotifications: true`). If the client registered a webhook and the webhook never fired, that is a *second* independent negative signal. When both streaming-close-without-terminal AND push-silence occur, the probability of true completion (vs. loss) drops sharply — this is the diagnostic conjunction. - The client has **no idempotent replay** of the original `message/send`. If it can replay with the same `id` and the executor dedupes, the client can re-drive to a terminal state. If the executor treats replay as a new task, the ambiguity is unresolvable. Outside these conditions — e.g., blocking mode, or an executor that guarantees `final: true` on every stream — the invariant holds and this record does not apply. ## Decision Boundary The architectural guardrail is a **terminal-state warrant**: a delegated task is considered *closed* only when the client observes a terminal `TaskState` from a source the card declared as authoritative, *and* that observation is correlated by `taskId` + `contextId` + a monotonically increasing `status.timestamp` (or event sequence). The decision boundary is: - If the stream closes and the last event is non-terminal → the client MUST NOT treat the task as done or failed. It MUST enter a `pending-reconciliation` state and issue `tasks/get` with exponential backoff, bounded by the card’s declared or negotiated `taskTtl`. - If `tasks/get` returns `TaskNotFoundError` while the stream closed non-terminal → the client MUST treat this as **warrant collapse**, not as completion. The correct response is to escalate to the delegating authority (the orchestrator that owns the `contextId`) and, if idempotent replay is supported, replay the original send with the same `id`; otherwise mark the subtask as `indeterminate` and fail the parent workflow *closed*, not open. - A card advertising `streaming: true` without a companion `capabilities.terminalEventsGuaranteed`-style assertion (or equivalent conformance proof) is a **weak warrant** and must be treated as best-effort. The invariant to enforce at the client: **never derive task completion from transport closure.** Transport closure is a transport fact; task completion is a state-machine fact. Conflating them is the bug. ## Operational Effect Downstream, warrant collapse manifests as: - **Silent duplicate execution.** The client, seeing no terminal state, replays the `message/send`. If the executor did not dedupe on `id`, the skill runs twice — and for side-effecting skills (write, deploy, pay) this is a correctness violation, not a latency cost. - **Orphaned context.** The executor’s task remains `working` indefinitely, holding a worker slot. Under load, a fleet of these exhausts the executor’s concurrency budget, which then *causes* real timeouts for subsequent delegations — the failure amplifies. - **Auditor disagreement.** In multi-agent setups with a separate auditor agent replaying the task log, the auditor sees `working, working, [close]` and the client sees `indeterminate`. Their verdicts diverge, and the consensus layer deadlocks waiting for the client to resolve a state the executor never emitted. The conformance test that catches this: a **negative-path card probe** that deliberately advertises `streaming: true` and then, under fault injection, closes the SSE channel mid-`working` without a terminal event. A conformant client must enter `pending-reconciliation` and must not emit a completion. Most cross-vendor suites test the happy path (terminal event arrives) and miss this entirely. ```python import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class WarrantCollapseError(RuntimeError): """Raised when a delegated A2A task loses its terminal-state warrant: the stream closed non-terminal AND the task lookup cannot confirm state.""" pass class TaskState(Enum): SUBMITTED = "submitted" WORKING = "working" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" INDETERMINATE = "indeterminate" @dataclass class AgentCard: streaming: bool push_notifications: bool skills: list[str] = field(default_factory=list) @dataclass class TaskEvent: state: TaskState final: bool timestamp: float @dataclass class DelegationClient: card: AgentCard task_ttl_s: float = 300.0 def reconcile( self, task_id: str, context_id: str, stream_events: list[TaskEvent], lookup_fn, # returns Optional[TaskEvent]; None == TaskNotFoundError ) -> TaskState: # Invariant: completion is a state-machine fact, never a transport fact. last = stream_events[-1] if stream_events else None if last is not None and last.final and last.state in ( TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED ): return last.state # Stream closed non-terminal. We are in pending-reconciliation. if not self.card.streaming: # Card never promised streaming; close is not a warrant claim. return TaskState.INDETERMINATE deadline = time.monotonic() + self.task_ttl_s backoff = 0.5 while time.monotonic() < deadline: observed = lookup_fn(task_id, context_id) if observed is not None: if observed.final and observed.state in ( TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED ): return observed.state # Still working on the executor side; keep waiting. time.sleep(backoff) backoff = min(backoff * 2, 8.0) # Both streaming and lookup failed to yield a terminal state. # This is warrant collapse, not completion. raise WarrantCollapseError( f"task {task_id} (context {context_id}): stream closed non-terminal " f"and tasks/get never returned a terminal state within " f"{self.task_ttl_s}s; refusing to derive completion from transport close" ) ```