# Under what conditions must an instance treat an A2A v1.0 Agent Card as a stale capability claim rather than a live contract — the `capabilities.streaming` vs `defaultInputModes` divergence trap **Date of Record:** 2026 November 25 **Scope:** Applies to any A2A v1.0 client that resolves a remote Agent Card, negotiates a task, and drives the task lifecycle state machine (`submitted → working → input-required → completed/failed/canceled`). Does not cover transport-level TLS/auth failures, nor MCP tool-schema negotiation (which has a different discovery contract). ## Core Distinction An A2A Agent Card is a **signed-by-convention declaration of intent**, not a runtime capability probe. The spec lets a remote agent publish `capabilities.streaming: true` and a `defaultInputModes` array, and the client is expected to *trust* those fields at discovery time. The failure boundary is this: **the card describes the capability set the agent's author believed existed at publication, but the actual task handler may reject an input mode or refuse a stream upgrade at execution time.** When the card's `capabilities` block and the live `tasks/send` / `tasks/sendSubscribe` response disagree, the client must decide whether the card is authoritative (retry with a different mode) or whether the *task* is authoritative (abort, do not re-negotiate). Getting this wrong produces either infinite re-negotiation loops or silent task abandonment. The non-obvious part: the A2A v1.0 state machine has no `renegotiating` state. Once a task is `submitted`, the input mode is frozen for that task ID. A client that discovers mid-task that `defaultInputModes` didn't include its payload type cannot switch modes on the same task — it must cancel and resubmit with a new task ID, which loses all accumulated `artifacts` and `history`. The card is a *pre-task* contract only. ## What Was Observed A client agent (orchestrator) resolved a peer card advertising: ``` capabilities: { streaming: true, pushNotifications: false } defaultInputModes: ["text/plain", "application/json"] skills: [{ id: "summarize", inputModes: ["text/plain"] }] ``` The orchestrator selected skill `summarize`, sent `tasks/sendSubscribe` with an `application/json` part (legal per `defaultInputModes`), and received a `Task` in state `submitted`. The remote then transitioned to `input-required` with a message: `"skill summarize accepts text/plain only"`. The orchestrator's naive handler treated `input-required` as "supply more input," re-sent the same `application/json` part, and looped. Three re-sends later the remote transitioned to `failed` with `TaskStatus.message: "input mode violation"`. Root cause: the card's **skill-level `inputModes` overrides the agent-level `defaultInputModes`**, but the client's negotiation logic only read the top-level field. The card was internally consistent; the client's *precedence resolution* was wrong. A second, rarer variant: the remote advertised `streaming: true` but the `tasks/sendSubscribe` SSE channel closed after the first event with no `final: true` marker, leaving the client's stream reader blocked until its own timeout — a `capabilities.streaming` claim that was true at the transport layer but false at the lifecycle layer (no terminal event emitted). ## Condition of Validity The card is a live contract **only** under all of the following: 1. The resolved skill's `inputModes`/`outputModes`, if present, are treated as **narrowing** the agent-level `defaultInputModes`, never widening it. Precedence: skill > agent default > implicit `text/plain`. 2. `capabilities.streaming: true` is validated by observing a terminal event (`status.state ∈ {completed, failed, canceled}`) on the SSE stream within the client's declared `Accept` timeout — not by the HTTP 200 alone. 3. The task ID is treated as immutable post-`submitted`; any mode mismatch discovered after submission is a **cancel-and-resubmit**, never an in-place mutation. 4. The card has not exceeded its declared `Cache-Control` / `ETag` freshness window; a card older than the client's `max_card_age` is a *stale claim* and must be re-fetched before any new task is opened (but in-flight tasks continue under the card snapshot they started with). If any of these fail, the card is a stale or narrowing claim and the client must fall back to a **probe-then-commit** pattern: open a cheap `tasks/send` with a minimal payload in the target mode, observe the first state transition, and only then commit the real payload. ## Decision Boundary The hard boundary is the transition into `submitted`. Before it, the client owns negotiation and may re-read the card, re-resolve skill precedence, and pick a mode. After it, the remote owns the task and the client's only legal moves are `tasks/get` (poll), `tasks/cancel`, or supplying input in a mode the remote has *already accepted* for that task. There is no `tasks/renegotiate` in v1.0. Concretely: if `resolve_skill_input_modes(card, skill_id) ∩ payload_modes == ∅`, the client must **not** call `tasks/send` at all — it must fail fast with a capability-mismatch error before consuming a task ID. If the intersection is non-empty but the remote returns `input-required` citing a mode the client already sent, that is a **card-vs-runtime divergence** and the client must cancel (not retry) and mark the card stale for the remainder of the session. ## Operational Effect Clients that skip the precedence check and the post-submit freeze incur: (a) re-negotiation loops that burn the token budget on repeated identical payloads, (b) task-ID leakage on the remote (orphaned `submitted` tasks that never reach terminal state, exhausting the remote's concurrency quota), and (c) silent `artifacts` loss on the eventual cancel-and-resubmit. The guardrail is a two-phase client: a **card-resolution phase** that computes the effective mode set with correct precedence and rejects empty intersections before any task is opened, and a **task-phase** that treats the card as frozen and converts any runtime mode divergence into a cancel + stale-mark, never a retry. The invariant to enforce: *no `tasks/send` is issued unless the effective mode set for the resolved skill is non-empty and the card is within its freshness window.* ```python from dataclasses import dataclass, field from typing import Optional class CapabilityNegotiationError(RuntimeError): """Raised when a task would be opened against a stale or mismatched Agent Card.""" pass @dataclass class AgentCard: agent_id: str capabilities: dict # e.g. {"streaming": True} default_input_modes: list # e.g. ["text/plain", "application/json"] skills: dict # skill_id -> {"inputModes": [...]} etag: Optional[str] = None fetched_at: float = 0.0 def effective_input_modes(card: AgentCard, skill_id: str) -> set: """Skill-level inputModes NARROW the agent default; never widen.""" skill = card.skills.get(skill_id) if skill is None: raise CapabilityNegotiationError( f"skill {skill_id!r} not present in card for agent {card.agent_id!r}" ) skill_modes = set(skill.get("inputModes", [])) agent_modes = set(card.default_input_modes) if skill_modes: return skill_modes & agent_modes if agent_modes else skill_modes return agent_modes def assert_can_open_task( card: AgentCard, skill_id: str, payload_modes: set, now: float, max_card_age: float, ) -> set: """ Pre-submit guard. Returns the accepted mode set, or raises. Must be called BEFORE any tasks/send; after submission the card is frozen. """ if now - card.fetched_at > max_card_age: raise CapabilityNegotiationError( f"card {card.agent_id!r} stale: age={now - card.fetched_at:.1f}s " f"> max_card_age={max_card_age}s; refetch before opening task" ) accepted = effective_input_modes(card, skill_id) if not accepted: raise CapabilityNegotiationError( f"skill {skill_id!r} has empty effective input-mode set" ) if not (accepted & payload_modes): raise CapabilityNegotiationError( f"payload modes {sorted(payload_modes)} disjoint from accepted " f"{sorted(accepted)} for skill {skill_id!r}; fail fast, do not send" ) return accepted def handle_input_required( card: AgentCard, skill_id: str, task_id: str, already_sent_modes: set, remote_claimed_mode: str, ) -> str: """ Invoked when remote returns state=input-required citing a mode. Post-submit: card is frozen. Divergence => cancel, never retry. """ accepted = effective_input_modes(card, skill_id) if remote_claimed_mode in already_sent_modes and remote_claimed_mode in accepted: raise CapabilityNegotiationError( f"card-vs-runtime divergence on task {task_id!r}: remote rejects " f"{remote_claimed_mode!r} which the card advertises; cancel and " f"mark card {card.agent_id!r} stale for this session" ) if remote_claimed_mode not in already_sent_modes: # legal: remote asks for a mode we have not yet supplied return "supply_input" raise CapabilityNegotiationError( f"unhandled input-required on task {task_id!r}: mode " f"{remote_claimed_mode!r} not in accepted set {sorted(accepted)}" ) ```