# Under what conditions must an instance reject an A2A v1.0 Agent Card whose declared `defaultInputModes`/`defaultOutputModes` are a superset of the task's actual media type, and how does late-bound capability negotiation silently poison the task state machine **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 clients that resolve an Agent Card at `/.well-known/agent.json`, negotiate a task via `tasks/send`, and rely on streaming `TaskStatusUpdateEvent` transitions. Does not apply to single-vendor closed-loop deployments where client and server share a build artifact and capability drift cannot occur. ## Core Distinction The failure is not a schema mismatch. In A2A v1.0, the Agent Card advertises *default* input/output modes (`defaultInputModes`, `defaultOutputModes`) plus per-skill overrides under `skills[].inputModes` / `skills[].outputModes`. A conformant client checks the card, sees `text/plain` in the default set, and dispatches a `text/plain` part. The server accepts the task, transitions `submitted → working`, and only at the *first tool invocation* discovers the selected skill's `outputModes` are `["application/json", "text/markdown"]` with no `text/plain` fallback. The task is now committed to `working` with a payload the terminal renderer cannot consume. The distinction that matters: **the Agent Card is a discovery artifact, not a capability contract.** It is a *projection* of server-side routing logic that may be resolved per-skill, per-tenant, or per-request, and the A2A spec does not require the card's defaults to be a superset of any skill's effective modes. Treating the card as an authoritative contract produces a state machine that is *syntactically* valid at every transition but *semantically* wedged at `working` — a livelock that no timeout will resolve because `working` is a legal, non-terminal state. ## What Was Observed A cross-vendor client (vendor A) resolved an Agent Card from vendor B's gateway. The card declared: ``` defaultInputModes: ["text/plain", "application/json"] defaultOutputModes: ["text/plain", "application/json"] skills: [{ id: "invoice-extract", inputModes: ["application/json"], outputModes: ["application/json"] }] ``` Client A dispatched a `tasks/send` with a `text/plain` message part, because its routing layer matched on `defaultInputModes` and did not descend into `skills[]`. Vendor B's dispatcher resolved the skill by intent classifier, selected `invoice-extract`, and — correctly per its own `inputModes` — attempted to parse the `text/plain` part as JSON. Parse failed. The server emitted: ``` TaskStatusUpdateEvent { state: "working", final: false } ``` with no error, because the parse failure was caught in the skill's validation layer and re-queued as a retryable condition. The client, seeing `working`, waited. After 90s the server's internal retry budget exhausted and it emitted `failed` with `reason: "input validation"` — but by then the client had already logged `working` as success-of-submission and moved its own state machine to `awaiting-result`, which it never left because it had no handler for `failed` arriving after a non-final `working` (its FSM treated `failed` as only reachable from `submitted`). The observable trace was: `submitted → working → (90s gap) → failed`, with the client's FSM stuck at `awaiting-result` and the server's task record at `failed`. Divergent terminal states across the two instances for the same `taskId`. ## Condition of Validity The invariant that must hold for safe dispatch is: > For every `(skill, requestedMediaType)` pair the client may emit, `requestedMediaType ∈ skill.inputModes` **and** the client's renderer can consume at least one element of `skill.outputModes`. This is *stricter* than the A2A v1.0 conformance requirement, which only mandates that the card be well-formed and that the server reject unsupported input modes. The spec permits a server to accept-and-then-fail; it does not require pre-dispatch rejection. Therefore the client cannot rely on the server to enforce the invariant — it must enforce it locally, which means **descending into `skills[]` and intersecting `inputModes`/`outputModes` against the client's own media-type capabilities before `tasks/send`.** The condition fails in three concrete ways: 1. **Default-superset illusion.** `defaultInputModes ⊋ skill.inputModes`. Client matches on default, server matches on skill. The card is legal; the dispatch is illegal. 2. **Empty per-skill override.** A skill with `inputModes: []` means "inherit default" per spec, but some vendor implementations emit `[]` to mean "no inputs accepted" (a pure-push skill). The client cannot distinguish these two readings from the card alone. 3. **Late-bound output mode.** Server resolves `outputModes` at skill-execution time based on tenant config, not card time. The card says `text/plain`; the tenant's routing says `application/json`. The card is stale by construction. ## Decision Boundary The boundary is: **does the client treat the card as a capability *declaration* (trust, dispatch, handle failure) or a capability *negotiation input* (intersect, reject-on-empty, dispatch only on non-empty intersection)?** The correct side of the boundary is negotiation-input. Concretely: - If `skill.inputModes ∩ client.emittableModes = ∅` → **do not dispatch**; raise a pre-flight rejection. This is the only safe response to a skill whose declared inputs the client cannot satisfy, because the server is not obligated to reject early. - If `skill.outputModes ∩ client.consumableModes = ∅` → **do not dispatch**; a task that can only terminate in a mode the client cannot render is a guaranteed divergence. - If a skill's `inputModes` is `[]` and the client reads it as "inherit default," it must *also* verify the server's behavior by probing `tasks/get` on a synthetic task or by reading the server's `capabilities` block; if neither disambiguates, treat `[]` as "no inputs" and reject. The boundary is *not* "retry on failure." Retry cannot recover from a media-type mismatch because the mismatch is structural, not transient. A retry loop against a skill whose `outputModes` exclude the client's renderer will exhaust the token budget and produce a `failed` that the client's FSM may again fail to handle. ## Operational Effect The downstream effect is a **split-brain terminal state**: the server's task record reaches `failed`, the client's FSM reaches `awaiting-result` and stalls. Because A2A task IDs are opaque and the client holds no lease, the client cannot distinguish "server still working" from "server failed and I missed the event" without a `tasks/get` reconciliation poll. If the client's reconciliation poll interval exceeds the server's task-retention window (often 5–15 minutes for vendors B-class gateways), the task record is garbage-collected and the client's `tasks/get` returns `404`, which most client FSMs map to `unknown` — a state with no defined exit. The second-order effect is worse: the client's audit log records `working` as the last-known state, and any downstream auditor replaying the trace sees a task that was "in progress" at log-close. Cross-vendor conformance suites that replay these traces will flag the client as non-conformant on `TaskStatusUpdateEvent` handling, even though the client handled every event it received correctly. The failure is attributed to the wrong party. The guardrail is a **pre-dispatch capability intersection gate plus a reconciliation poll with a lease shorter than the server's retention window**, and an FSM that permits `failed` from *any* non-terminal state, not just `submitted`. ```python import time from dataclasses import dataclass from typing import Optional class CapabilityNegotiationError(RuntimeError): """Raised when client and skill media types have empty intersection.""" pass class TaskReconciliationError(RuntimeError): """Raised when tasks/get returns 404 after a non-terminal local state.""" pass @dataclass class AgentCard: default_input_modes: list[str] default_output_modes: list[str] skills: dict[str, dict] @dataclass class ClientCapabilities: emittable: set[str] consumable: set[str] def negotiate(card: AgentCard, skill_id: str, client: ClientCapabilities) -> tuple[str, str]: """Return (input_mode, output_mode) or raise before dispatch.""" skill = card.skills.get(skill_id) if skill is None: raise CapabilityNegotiationError(f"skill {skill_id} absent from card") # Per-skill override wins; empty list is ambiguous, treat as no-inputs. in_modes = skill.get("inputModes") out_modes = skill.get("outputModes") if in_modes is None: in_modes = card.default_input_modes if out_modes is None: out_modes = card.default_output_modes in_ok = client.emittable.intersection(in_modes) out_ok = client.consumable.intersection(out_modes) if not in_ok: raise CapabilityNegotiationError( f"skill {skill_id}: client emits {sorted(client.emittable)}, " f"skill accepts {in_modes!r}" ) if not out_ok: raise CapabilityNegotiationError( f"skill {skill_id}: client consumes {sorted(client.consumable)}, " f"skill produces {out_modes!r}" ) return sorted(in_ok)[0], sorted(out_ok)[0] def reconcile(task_id: str, poll_interval_s: float, retention_s: float) -> Optional[str]: """Poll tasks/get; raise if retention window exceeded while local state non-terminal.""" deadline = time.monotonic() + retention_s while time.monotonic() < deadline: status = _tasks_get(task_id) # returns None on 404 if status is None: raise TaskReconciliationError( f"task {task_id} GC'd before terminal state observed; " f"local FSM may be wedged at awaiting-result" ) if status in ("completed", "failed", "canceled"): return status time.sleep(poll_interval_s) raise TaskReconciliationError( f"task {task_id} exceeded {retention_s}s retention without terminal state" ) def _tasks_get(task_id: str) -> Optional[str]: raise NotImplementedError # wire to transport ```