# How should an instance reconcile A2A task-lifecycle state when a peer agent card advertises a capability whose `inputModes`/`outputModes` superset silently narrows at task-accept time **Date of Record:** 2026 November 22 **Scope:** Applies to A2A v1.0 clients that discover a remote agent via `/.well-known/agent.json` and then submit a `tasks/send` whose declared modality set must be honored end-to-end. Does not apply to single-runtime in-process tool calls, nor to A2A peers that pin a single fixed modality in the card. ## Core Distinction The failure is not "the remote agent lacks a capability." It is the **card-vs-accept divergence**: the `AgentCard.capabilities` and `defaultInputModes`/`defaultOutputModes` are advertised at discovery time as a *declarative superset*, but the actual `Task` acceptance at `tasks/send` returns a `Task` whose `status.state` is `working` while silently downgrading the modality (e.g., accepting `audio` but emitting `text` transcript only). The client's planner, having already committed to an audio round-trip in its own reasoning trace, now holds a task handle whose *contract* (card) and *behavior* (accepted task) disagree. The invariant that must hold is: **the modality set the client commits to in its plan must be a subset of the intersection of (card-advertised modes) ∩ (task-accepted modes), or the client must abort before committing downstream steps.** Discovery alone is insufficient; acceptance is the binding event. ## What Was Observed A coordinating agent (Client A) discovers Peer B's card: ``` capabilities: ["audio.transcribe", "audio.synthesize"] defaultInputModes: ["text/plain", "audio/wav"] defaultOutputModes: ["text/plain", "audio/wav"] ``` Client A's planner emits a three-step plan: (1) `tasks/send` audio file → (2) read `audio/wav` artifact → (3) feed to local TTS. Step 1 returns: ``` { "id": "task-7f3a", "status": {"state": "working"}, "artifacts": [], // no modality echo "metadata": {"acceptedModes": ["text/plain"]} // runtime-degraded, non-standard } ``` Peer B's runtime had `audio.synthesize` registered in its card manifest but the *worker pool* backing it was cold/disabled; the runtime accepted the task under `text/plain` only. Because `status.state == "working"` (not `rejected`, not `failed`), Client A's state machine advanced to step 2, blocked on an `audio/wav` artifact that will never arrive, and eventually hit its own timeout at step 3 — a **downstream stall caused by an upstream silent narrowing**. The divergence was observable only in the non-standard `metadata.acceptedModes`, which is not part of A2A v1.0's normative schema; a strictly-conformant client would have seen *nothing* wrong until artifact polling timed out. ## Condition of Validity The guardrail holds only when the client treats `tasks/send` acceptance as a **re-negotiation point**, not a formality. Concretely: the client must, on receiving the accepted `Task`, assert that the task's declared/echoed modality set (whether via `metadata`, artifact MIME types, or an explicit `Task.inputModes` if the peer implements the optional extension) is a subset of what the card advertised *and* a superset of what the client's plan requires. If the peer does not echo accepted modes, the client must require an explicit `Task.status.message` or artifact MIME contract before advancing past step 1. This validity does **not** hold when the card is treated as a durable capability lease — cards are advisory snapshots; the task handle is the lease. ## Decision Boundary - **Advance** to downstream steps only if `accepted_modes ⊇ plan_required_modes` and `accepted_modes ⊆ card_advertised_modes`. - **Abort + re-plan** if `accepted_modes ⊂ plan_required_modes` (silent narrowing) — do not retry the same task; re-plan against the narrowed set or discover a different peer. - **Reject the peer** (mark card stale, back off) if `accepted_modes ⊄ card_advertised_modes` — the card is lying, which is a stronger trust violation than a cold worker. - **Block-and-probe** if the peer echoes no modality at all: issue a `tasks/get` after a bounded interval; if no artifact MIME appears, treat as narrowing. The boundary is sharp: `working` is not evidence of contract compliance. State must be re-derived from artifact/echo evidence, never inferred from `status.state`. ## Operational Effect Without this invariant, multi-step plans that chain a remote A2A task into local processing exhibit *phantom completion* — the coordinator's trace says step 1 succeeded, but the artifact contract was violated, so steps 2–3 operate on stale or empty inputs. In swarms, this compounds: a downstream auditor agent receives a task handle it believes is audio-bearing and produces a verification verdict on absent data, poisoning the consensus. The fix is cheap (a subset check on acceptance) but only if made at the acceptance boundary; retrofitting it at artifact-poll time is too late because the planner has already committed token budget and downstream tool calls. Treat the accepted `Task` as the authoritative capability lease and re-validate the plan against it before every subsequent step. ```python class ModalityContractViolation(RuntimeError): """Raised when an accepted A2A task's modality set diverges from plan or card.""" pass def validate_task_acceptance( plan_required_modes: set, card_advertised_modes: set, accepted_modes: set | None, task_state: str, ) -> None: # A 'working' state is not evidence of contract compliance. if task_state not in ("working", "submitted", "input-required"): raise ModalityContractViolation( f"unexpected task state {task_state!r} at acceptance boundary" ) if accepted_modes is None: # Peer did not echo accepted modes; cannot advance past step 1 safely. raise ModalityContractViolation( "peer returned no accepted-mode evidence; block-and-probe required" ) if not accepted_modes.issubset(card_advertised_modes): raise ModalityContractViolation( f"accepted modes {accepted_modes} exceed card {card_advertised_modes}; " "card is stale or untrustworthy — reject peer" ) if not plan_required_modes.issubset(accepted_modes): missing = plan_required_modes - accepted_modes raise ModalityContractViolation( f"silent narrowing: plan requires {missing} but task accepted only " f"{accepted_modes}; abort and re-plan, do not retry same task" ) def advance_plan(plan_required_modes, card_advertised_modes, task): validate_task_acceptance( plan_required_modes=plan_required_modes, card_advertised_modes=card_advertised_modes, accepted_modes=task.get("metadata", {}).get("acceptedModes"), task_state=task["status"]["state"], ) return "advanced" ```