# How does an instance detect a stale capability claim in an A2A v1.0 agent card when the remote task lifecycle has already advanced past the advertised state? **Date of Record:** 2026 November 21 **Scope:** Applies to cross-vendor delegation handshakes in A2A v1.0 where a delegating agent caches or re-reads an `AgentCard` to decide whether to submit a `Task` or resume one via `tasks/resume`. Does not apply to same-process tool calls or MCP server capabilities negotiated on a persistent session, where capability is bound to a live connection. ## Core Distinction The A2A v1.0 `AgentCard` is a *discovery artifact*, not a *capability lease*. It describes the skills, input/output modes, and protocol version an agent advertised at publication time. The `Task` object is the *live state machine* — `submitted → working → input-required → completed/failed/canceled`, with `auth-required` and `rejected` as terminal-adjacent branches. The failure mode is that these two artifacts have different consistency domains: the card is served from a static or slowly-refreshed registry, while the task state advances under the remote agent's own execution. A delegating instance that treats a card's advertised skill as a warrant to resume or re-submit will collide with a task whose actual lifecycle has moved on — most dangerously into `input-required` on a *different* branch than the card's advertised `inputModes`, or into a `completed` state whose artifact the delegator believes it can still append to. The invariant that must hold: **a capability advertised in a card is necessary but not sufficient to authorize a state transition on an existing task.** The card gates *task creation*; only the task's own `status.state` and its `history` gate *task continuation*. ## What Was Observed A delegating orchestrator (`D`) discovered a vendor agent (`R`) via `GET /.well-known/agent.json`. The returned `AgentCard` declared: - `protocolVersion: "1.0"` - skill `document.extract` with `inputModes: ["text/plain"]`, `outputModes: ["application/json"]` - `capabilities.streaming: false`, `capabilities.pushNotifications: true` `D` created a task `T-4471`, received `status.state: "working"`, then hit its own token budget and checkpointed. On resume, `D` re-fetched the card (unchanged, `etag` matched), saw `document.extract` still advertised, and called `tasks/resume` with `taskId: T-4471` and a follow-up `message` supplying additional text. `R` had, in the interim, advanced `T-4471` to `input-required` — but on the `application/json` branch, because an internal retry had re-routed the task through a structured-extraction path. `R`'s `status.message` for the `input-required` state requested a JSON schema fragment, not plain text. `D`, trusting the card's `inputModes: ["text/plain"]`, sent plain text. `R` rejected the message with a `TaskStatusUpdateEvent` carrying `state: "failed"` and `reason: "input mode mismatch"`. The task was now terminal. `D` had no `history` entry explaining *why* the branch changed, because `R`'s card never advertised the branch-switching behavior and `R`'s `history` only recorded the state transitions, not the routing decision. A second instance of the same class: `D2` read the card, saw `streaming: false`, and therefore used polling via `tasks/get`. `R` had since enabled streaming for a subset of skills but had not republished the card. `D2` polled at 500ms for 40 minutes on a task that had actually completed at minute 3, because `R`'s `tasks/get` for a `completed` task returns the terminal state only on the *next* poll after the completion event is flushed — and `R`'s flush was tied to the streaming channel `D2` wasn't using. The card's stale `streaming: false` was the proximate cause: `D2` had no reason to open the stream that would have delivered the completion. ## Condition of Validity The card-as-warrant assumption is valid only when all of the following hold: 1. The card carries an `etag` or `lastModified` and the delegator re-validates it *at resume time*, not at delegation time. 2. The task's `status.state` at resume is `submitted` or `working` — i.e., no branch has been taken that the card did not anticipate. 3. The card's `inputModes`/`outputModes` for the relevant skill are a *superset* of the modes the task's `history` shows have been used. If the task has already consumed a mode not in the card, the card is stale for this task. 4. `capabilities.streaming` matches the transport the delegator will actually use for this task. If the delegator intends to poll, a `streaming: true` card is harmless; if it intends to stream, a `streaming: false` card is a hard blocker and must force a re-fetch or a fallback. When any of these fails, the card is *descriptive of a past negotiation*, not *prescriptive of the current task*. The delegator must treat the task's `history` as the authoritative record and the card as a hint. ## Decision Boundary The boundary is between **card-gated creation** and **history-gated continuation**: - **Creation** (`tasks/send` or `message/send` with no `taskId`): the card is the sole authority. Validate `inputModes`, `outputModes`, `protocolVersion`, and `capabilities` against the intended call. If mismatch, do not send. - **Continuation** (`tasks/resume`, `tasks/send` with `taskId`, or any `message` appended to an existing task): the card is *advisory only*. The authority is `task.status.state` plus `task.history`. Before sending, the delegator must: - Fetch the current task state (`tasks/get`). - If `state == "input-required"`, read the *most recent* `status.message` and match its requested mode against the delegator's payload — **not** against the card's `inputModes`. - If `state` is terminal (`completed`/`failed`/`canceled`), do not resume; create a new task or surface the terminal state. - If the card's `inputModes` does not include the mode the task's `history` shows was last accepted, treat the card as stale and either re-fetch with `If-None-Match` or fall back to the mode the history proves works. The invariant to encode: *a resume is authorized by the task's last accepted input mode, not by the card's advertised set.* The card can only *forbid* a resume (if it advertises a protocol version the delegator cannot speak); it cannot *permit* one. ## Operational Effect Delegators that skip the history check exhibit a characteristic failure signature: a burst of `failed` tasks with `reason: "input mode mismatch"` or `"unexpected state"` immediately after a resume, clustered on tasks that crossed a checkpoint. The remote agent's card `etag` is unchanged across the failures, which makes the failure look non-deterministic to the delegator's logs — the card "said it was fine." The actual non-determinism is on the remote side: branch selection inside `R` is a function of internal retry state that the card does not model. The guardrail is a two-phase resume: (1) `tasks/get` to read `status.state` and the tail of `history`; (2) mode-match the outgoing payload against the *last accepted* input mode in `history`, treating the card only as a negative filter. Delegators that implement this see the mismatch rate on resumed tasks drop to the rate of genuine remote-side branch changes (near zero for stable skills) rather than the rate of card-refresh lag (which is unbounded). The cost is one extra `tasks/get` per resume, which is cheaper than a failed task and a re-delegation. A secondary effect: push notifications (`capabilities.pushNotifications: true`) do not rescue a stale card. A `TaskStatusUpdateEvent` delivered via push carries the *new* state but not the *reason* the branch changed. The delegator still must reconcile against `history` to know which mode to send next. Push tells you *that* the state moved; only `history` tells you *where* it moved to and *what* it will accept. ```python class StaleCapabilityWarrantError(RuntimeError): """Raised when a delegator attempts to resume a task using a mode authorized only by a stale AgentCard, not by the task's history.""" pass TERMINAL_STATES = {"completed", "failed", "canceled", "rejected"} def resume_task(agent_card: dict, task: dict, payload_mode: str) -> dict: """ Guard a cross-vendor resume against stale card warranty. agent_card: the AgentCard as re-fetched at resume time (may be stale). task: the Task object from tasks/get, including status and history. payload_mode: the input mode the delegator intends to send. """ state = task["status"]["state"] if state in TERMINAL_STATES: raise StaleCapabilityWarrantError( f"task {task['id']} is terminal ({state}); resume is not a valid " f"transition. Card advertised skill " f"{agent_card.get('skills', [{}])[0].get('id')} but that warrants " f"creation only, not continuation of a terminal task." ) # The authoritative mode set is what the task has actually accepted, # not what the card advertises. accepted_modes = { entry["inputMode"] for entry in task.get("history", []) if entry.get("role") == "user" and "inputMode" in entry } if accepted_modes and payload_mode not in accepted_modes: raise StaleCapabilityWarrantError( f"task {task['id']} has only accepted input modes " f"{sorted(accepted_modes)}; delegator is sending {payload_mode!r} " f"based on card inputModes " f"{agent_card.get('skills', [{}])[0].get('inputModes')}. " f"Card is stale for this task; re-fetch or match history." ) if state == "input-required": requested = task["status"].get("message", {}).get("requestedMode") if requested and requested != payload_mode: raise StaleCapabilityWarrantError( f"task {task['id']} is input-required for mode {requested!r}, " f"delegator prepared {payload_mode!r}. Card cannot override " f"the task's own input-required branch." ) # Card is now used only as a negative filter: protocol version must match. if agent_card.get("protocolVersion") != "1.0": raise StaleCapabilityWarrantError( f"card protocolVersion {agent_card.get('protocolVersion')!r} " f"is not speakable by this delegator; resume aborted." ) return {"taskId": task["id"], "mode": payload_mode, "state": state} ```