# What happens when an instance negotiates an A2A task against a stale agent card and the remote vendor's task lifecycle silently forks **Date of Record:** 2026 December 4 **Scope:** Applies to cross-vendor delegation over A2A v1.0 where the delegating (client) agent resolves a remote AgentCard, then issues `tasks/send` or `tasks/sendSubscribe` against it. Does not cover intra-process sub-agent calls, MCP tool invocation, or A2A versions prior to v1.0 where `tasks/resubscribe` semantics differ. ## Core Distinction The failure mode is not "the remote agent is down" (connection refused, clean 5xx, timeout). Those are detectable. The failure is that the remote agent *answers successfully* while operating a task lifecycle that diverges from the one the client's card cache advertised. The client believes it holds a live task in state `working`; the server has already transitioned the task to `input-required` and is waiting for a follow-up it will never receive, or has transitioned to `completed` and reaped the task record. Both sides are healthy. The contract between them is not. The specific non-obvious invariant at stake: **an A2A task's terminality is defined by the server's state machine, but the client's ability to observe that terminality depends on the card's advertised `capabilities.streaming` and `capabilities.pushNotifications` flags being accurate for the task instance actually created.** When a card advertises `streaming: true` but the specific task was created in a non-streaming mode (because the server degraded under load, or because a routing layer selected a different backend), the client that relies on the SSE stream to learn about `input-required` will block forever on a stream that never emits, while the server considers the task paused and awaiting input. ## What Was Observed A delegating orchestrator (vendor A) resolves the AgentCard for a specialist agent (vendor B) at startup and caches it for the session lifetime. The card declares: ``` capabilities: { streaming: true, pushNotifications: true, stateTransitionHistory: false } skills: [ { id: "invoice-reconcile", inputModes: ["text"], outputModes: ["text","data"] } ] ``` The orchestrator issues `tasks/sendSubscribe` for `invoice-reconcile`. Vendor B's edge router accepts the request and — because the primary reconcile worker pool is saturated — routes to a fallback worker that was deployed before the streaming capability was enabled. The fallback worker creates the task, transitions it `submitted → working`, then hits a schema ambiguity in the input (an amount field formatted with a thousands separator) and transitions to `input-required`, emitting a `TaskStatusUpdateEvent` on a *push notification channel* rather than the SSE stream, because its local config has `streaming: false` and it falls back to webhook. The client never registered a webhook URL (the card said streaming was available, so why would it). The SSE connection stays open, heartbeating, emitting nothing. Trace: 1. `t=0s` client opens SSE to `/tasks/sendSubscribe`, receives `Task` with `status.state = "working"`, `id = tsk_9f2`. 2. `t=1.2s` server worker transitions to `input-required`, attempts push to unregistered endpoint, drops event, logs `WARN push target absent`. 3. `t=1.2s–t=300s` client SSE stream emits only keepalive comments (`: ping`). Client's task state remains `working` in local memory. 4. `t=300s` client's idle-stream watchdog fires, marks task `failed: stream_timeout`, and — critically — *does not* issue `tasks/get` to reconcile, because its retry policy treats stream timeout as terminal. 5. `t=301s` client re-delegates the same invoice to a *different* specialist (vendor C) to make progress. Vendor B's task `tsk_9f2` remains in `input-required` until its own TTL reaper deletes it at `t=3600s`. The invoice was reconciled twice, by two vendors, with divergent results, because the client could not distinguish "server is thinking" from "server is waiting for me." ## Condition of Validity The guardrail invariant that bounds this failure: **a client MUST NOT treat SSE silence as evidence of server progress, and MUST NOT treat stream termination as the sole terminality signal.** The correct condition of validity for a delegation is a *reconciliation obligation*: on any stream timeout, keepalive-only interval exceeding `2 × advertised heartbeat`, or stream close without a terminal `TaskStatusUpdateEvent`, the client issues `tasks/get` with the task id before any state transition. The card's `capabilities.streaming` flag is a *hint about the transport the server prefers*, not a *guarantee that every task created under this card will emit on that transport*. Per-task capability can be narrowed by server-side routing, load-shedding, or per-tenant feature flags that the card does not expose. Corollary: the card cache TTL must be bounded by the shortest of (a) the card's own `ttl` if present, (b) the client's session lifetime, and (c) a hard ceiling (empirically 300s in cross-vendor deployments) because vendor B's fallback pool was deployed mid-session and the card was never re-fetched. ## Decision Boundary The decision boundary between "retry the same delegate" and "fail over to an alternate vendor" is *not* "did the stream close." It is: **did `tasks/get` return a task in a non-terminal state (`submitted`, `working`, `input-required`) that the client can still act on?** - If `tasks/get` returns `input-required`, the client MUST respond with `tasks/send` carrying the same `id` and the clarifying input, not re-delegate. Re-delegation here is the double-execution bug. - If `tasks/get` returns `working`, the client SHOULD re-open the stream via `tasks/resubscribe` (A2A v1.0) rather than `sendSubscribe`, and reset its watchdog. - If `tasks/get` returns `completed` or `failed`, the client may proceed to failover — but only after confirming the task id is terminal, because a `completed` task that the client never observed is a *result the client is about to discard and recompute*. - If `tasks/get` returns `404` (task reaped), the client may fail over *and* must log a `reaped-unobserved` event, because the server's TTL is shorter than the client's watchdog and this is a configuration mismatch, not a task failure. The boundary the client must never cross: transitioning local task state to `failed` on the basis of transport silence alone. Transport silence is not a task state. It is an absence of observation. ## Operational Effect The observable effect at fleet scale is *silent duplicate execution with divergent results*: two vendors reconcile the same invoice, produce different totals (rounding, tax jurisdiction inference), and the orchestrator — having marked the first attempt `failed` — accepts the second result without knowing a first exists. The downstream reconciliation ledger shows one entry; the vendor B audit log shows a completed-but-unobserved task. When finance later audits, the two ledgers disagree and neither side can reconstruct why. The secondary effect is *card-cache poisoning across sessions*: because the orchestrator's card cache outlived the vendor's deployment, every subsequent delegation in that session inherited the wrong streaming assumption. A single stale card produced N failed-and-retried delegations before the session ended. The architectural guardrail that bounds both: **task identity is the reconciliation key, not the transport.** Every delegation must carry a client-generated idempotency key echoed in the task metadata, and every terminality decision must be made against `tasks/get`, never against stream events. The stream is an optimization for latency; `tasks/get` is the source of truth. A client that treats the stream as authoritative has inverted the protocol's own layering. ```python import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class A2AReconciliationError(RuntimeError): """Raised when a delegation cannot be resolved to a terminal task state without risking duplicate execution or silent result discard.""" class TaskState(Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" REAPED = "reaped" # 404 from tasks/get TERMINAL = {TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED, TaskState.REAPED} @dataclass class AgentCard: agent_id: str streaming: bool push_notifications: bool fetched_at: float ttl: float = 300.0 def is_stale(self, now: Optional[float] = None) -> bool: return (now or time.time()) - self.fetched_at > self.ttl @dataclass class TaskView: task_id: str state: TaskState idempotency_key: str class DelegationClient: def __init__(self, card: AgentCard, max_silence_s: float = 30.0): self.card = card self.max_silence_s = max_silence_s def delegate(self, idempotency_key: str, payload: dict) -> TaskView: if self.card.is_stale(): # Stale card: capability flags may not reflect current routing. raise A2AReconciliationError( f"agent card for {self.card.agent_id} is stale; " f"streaming={self.card.streaming} cannot be trusted for this task" ) # ... issue tasks/sendSubscribe, open stream ... # On stream silence or close without terminal event, we MUST reconcile: task = self._reconcile_after_silence(idempotency_key) return task def _reconcile_after_silence(self, idempotency_key: str) -> TaskView: # Guardrail: silence is not terminality. Query tasks/get. task = self._tasks_get(idempotency_key) if task.state in TERMINAL: return task if task.state == TaskState.INPUT_REQUIRED: # Do NOT re-delegate. Respond on the same task id. return self._tasks_send(task.task_id, {"clarification": "..."}) if task.state == TaskState.WORKING: # Re-open stream via resubscribe, not sendSubscribe. return self._tasks_resubscribe(task.task_id) raise A2AReconciliationError( f"task {task.task_id} in non-terminal state {task.state} after " f"{self.max_silence_s}s of stream silence; refusing to fail over " f"without operator confirmation to avoid duplicate execution" ) def _tasks_get(self, idempotency_key: str) -> TaskView: # Real impl: HTTP GET /tasks/{id}; 404 -> TaskState.REAPED ... def _tasks_send(self, task_id: str, payload: dict) -> TaskView: ... def _tasks_resubscribe(self, task_id: str) -> TaskView: ... ```