# What structural signals indicate an A2A v1.0 Agent Card is stale: the `updatedAt`-vs-`taskState` divergence and the phantom-capability handoff trap **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 (and v1.0-compatible) cross-vendor delegation where a delegating agent (the *caller*) discovers a remote agent via its Agent Card (`.well-known/agent.json`), caches capability declarations, and later initiates a `tasks/send` or `tasks/sendSubscribe` handshake. Does **not** cover intra-process tool calls, MCP server negotiation, or single-vendor orchestrators that re-fetch the card on every turn. ## Core Distinction The non-obvious failure here is not "the card is out of date." It is that the Agent Card's **`skills[]` capability surface** and the remote agent's **live task lifecycle state machine** are two independently versioned artifacts that A2A v1.0 does not bind together. A card can be *structurally valid, freshly signed, and `updatedAt`-recent* while the skills it advertises have already been removed, renamed, or had their input schema narrowed behind a feature flag on the serving side. Callers conflate two signals that look like liveness: - **Card freshness** — `updatedAt` timestamp, signature validity, ETag on the `.well-known` fetch. - **Capability truth** — whether the remote runtime will actually accept a task for `skill.id` with the payload the caller constructed. A2A v1.0's discovery contract only guarantees the first. The second is only observable at the first `tasks/send` round-trip, and by then the caller has already committed a task ID, a `sessionId`, and possibly streamed partial tokens to its own user. The divergence between "card says the skill exists" and "runtime rejects the skill" is the boundary condition. The signal that predicts it is **not** the card's `updatedAt` — it is the *mismatch between the card's declared `inputModes`/`outputModes` and the `TaskStatusUpdateEvent` vocabulary the remote emits during the handshake*. ## What Was Observed A caller agent (`orchestrator-A`) delegating to a vendor agent (`vendor-B`) that had shipped a minor capability change without bumping a card major version. The trace: 1. `orchestrator-A` fetches `vendor-B`'s card. Card is signed, `updatedAt` is 40 seconds old, `skills[]` contains `{id: "summarize_doc", inputModes: ["text/plain"], outputModes: ["text/markdown"]}`. 2. `orchestrator-A` caches the card keyed by `(agentUrl, card.etag)`. The ETag matches on the next three calls, so the card is **never re-fetched** for the next 6 hours. 3. At T+6h, `orchestrator-A` sends `tasks/send` with `skillId: "summarize_doc"` and a `text/plain` part. 4. `vendor-B`'s runtime has since *narrowed* `summarize_doc` to require a `metadata.doc_type` field (a schema change that did not alter `skill.id` or `inputModes`). The runtime accepts the task, transitions `submitted → working`, then fails the handshake at the first tool invocation with `TaskState: failed` and an `error: {code: -32001, message: "missing required field doc_type"}`. 5. `orchestrator-A` had already emitted the task ID to its user and begun streaming a "summarizing…" status. The failure arrives **after** the caller has committed state, so it cannot silently retry with a corrected payload — it must invalidate the user-visible task and re-issue under a new `taskId`. The structural signal that *would* have predicted this: `vendor-B`'s card declared `capabilities.streaming: true` and `outputModes: ["text/markdown"]`, but the `TaskStatusUpdateEvent` stream it emitted on the failing call carried `final: true` on the `working` event — a lifecycle vocabulary that A2A v1.0 permits but that is inconsistent with a card advertising `streaming: true` for that skill. The card said "I stream"; the runtime said "I terminate early." That divergence is the stale-capability tell, and it is visible **before** the error, on the first status event. ## Condition of Validity The stale-capability trap is only live under a specific conjunction, and outside it the standard "re-fetch on ETag change" guardrail is sufficient: - The caller **caches** the card across sessions (necessary — otherwise every call re-validates). - The remote vendor changes **skill semantics without changing `skill.id`** (necessary — a new `id` forces a cache miss on the skill lookup even if the card is stale). - The remote's lifecycle vocabulary admits **early-terminating `working` events** or **`input-required` without a `requiredFields` hint** (necessary — otherwise the failure is caught at `submitted` and the caller can retry cheaply). When any of these is absent, the failure degrades to a routine schema-validation error at the first `tasks/send` and the caller's existing retry logic absorbs it. The trap is *specifically* the case where the runtime accepts the task, enters `working`, and only later reveals the capability gap — because that is the only path where the caller has already committed a `taskId` and streamed to its user. ## Decision Boundary The invariant the caller must enforce: **a cached card is valid for delegation only if the first `TaskStatusUpdateEvent` for a task on that card is consistent with the card's declared `capabilities` and the skill's declared `outputModes`.** Concretely, the caller must gate on the *first status event*, not on the `tasks/send` acknowledgment: - If the first event is `submitted` or `working` with `final: false` → card is consistent; proceed. - If the first event is `working` with `final: true`, or `input-required` without a `requiredFields` payload, or `failed` with code `-32001` (invalid params) → **card is stale for this skill**; abort the task, invalidate the card cache entry, re-fetch the card, and re-issue under a new `taskId` *before* surfacing any user-visible completion. The boundary is the moment between `tasks/send` returning a `taskId` and the first `TaskStatusUpdateEvent`. Committing user-visible state before that event is the architectural error. The guardrail is a **handshake barrier**: the caller buffers its own user-facing status until it has observed one non-final status event consistent with the card, or it has timed out (default 5s) and must treat the card as unverified. ## Operational Effect Without the barrier, the failure surfaces as a **phantom task**: the caller's user sees a task that reached `working` and then died, with an error message that names a field the caller never knew about. The caller's retry logic, keyed on `taskId`, cannot recover because the `taskId` is now terminal. The user-visible effect is a delegation that "worked" for six hours and then failed on the seventh call with no state to resume from. With the barrier, the same failure is caught at the first status event, the card is invalidated, and the caller re-fetches — discovering the narrowed schema **before** it has committed a `taskId` to its user. The cost is one extra round-trip on the first call after a vendor change; the benefit is that cross-vendor delegation failures become *pre-commitment* rather than *post-commitment*. The deeper operational lesson: in A2A v1.0, **card freshness and capability truth are not the same signal**, and the only place they can be reconciled is the first status event of a task. Treat that event as the handshake's real acknowledgment, not the `tasks/send` response. ```python import time from dataclasses import dataclass, field from typing import Optional class StaleAgentCardError(RuntimeError): """Raised when the first TaskStatusUpdateEvent contradicts the cached Agent Card.""" pass @dataclass class AgentCard: agent_url: str etag: str updated_at: float skills: dict # skill_id -> {"input_modes": [...], "output_modes": [...]} capabilities: dict # {"streaming": bool, ...} @dataclass class CachedCard: card: AgentCard fetched_at: float = field(default_factory=time.time) class A2ADelegator: HANDSHAKE_BARRIER_SECONDS = 5.0 def __init__(self, transport, card_ttl_seconds: float = 3600.0): self.transport = transport self.card_ttl = card_ttl_seconds self._cache: dict[str, CachedCard] = {} def _get_card(self, agent_url: str) -> AgentCard: cached = self._cache.get(agent_url) if cached and (time.time() - cached.fetched_at) < self.card_ttl: return cached.card card = self.transport.fetch_agent_card(agent_url) self._cache[agent_url] = CachedCard(card=card) return card def _invalidate(self, agent_url: str) -> None: self._cache.pop(agent_url, None) def delegate(self, agent_url: str, skill_id: str, payload: dict) -> str: card = self._get_card(agent_url) if skill_id not in card.skills: raise StaleAgentCardError( f"skill {skill_id!r} not declared on card for {agent_url}" ) task_id = self.transport.tasks_send(agent_url, skill_id, payload) # Handshake barrier: buffer user-visible state until first status event # is consistent with the card's declared capabilities. deadline = time.time() + self.HANDSHAKE_BARRIER_SECONDS first_event: Optional[dict] = None while time.time() < deadline: ev = self.transport.next_status_event(agent_url, task_id, timeout=0.5) if ev is None: continue first_event = ev break if first_event is None: # No status event within barrier: card is unverified, not necessarily stale. # Do NOT commit user-visible state; surface as retryable. self.transport.tasks_cancel(agent_url, task_id) raise StaleAgentCardError( f"no status event within {self.HANDSHAKE_BARRIER_SECONDS}s " f"for task {task_id}; card unverified" ) state = first_event.get("state") final = first_event.get("final", False) skill = card.skills[skill_id] streaming_declared = card.capabilities.get("streaming", False) # Divergence signal 1: card says streaming, runtime terminates on first event. if streaming_declared and final and state == "working": self._invalidate(agent_url) self.transport.tasks_cancel(agent_url, task_id) raise StaleAgentCardError( f"card for {agent_url} declares streaming=true for {skill_id!r} " f"but first event is working/final=true; card is stale" ) # Divergence signal 2: input-required without requiredFields hint. if state == "input-required" and not first_event.get("requiredFields"): self._invalidate(agent_url) self.transport.tasks_cancel(agent_url, task_id) raise StaleAgentCardError( f"card for {agent_url} skill {skill_id!r} entered input-required " f"without requiredFields; declared input_modes={skill['input_modes']} " f"do not cover runtime schema" ) # Divergence signal 3: immediate failed with invalid-params code. if state == "failed" and first_event.get("error", {}).get("code") == -32001: self._invalidate(agent_url) raise StaleAgentCardError( f"runtime rejected {skill_id!r} with -32001 after accepting task " f"{task_id}; card schema is stale, re-fetch required" ) # First event consistent with card: safe to commit user-visible state. return task_id ```