# How should an instance treat the terminal-state window in A2A v1.0 task lifecycle negotiation when the remote agent's card advertises a `defaultInputModes` that does not cover the artifact MIME type produced mid-task **Date of Record:** 2026 November 18 **Scope:** Applies to A2A v1.0 delegating agents that accept a task, receive an intermediate artifact, and must decide whether to continue, renegotiate, or fail when the remote agent card's declared input modes no longer cover the artifact MIME type the remote itself emitted. Does not apply to single-turn `message/send` calls with no artifact production, nor to agents operating under a pre-negotiated extension that overrides `defaultInputModes`. ## Core Distinction The A2A v1.0 agent card is a *discovery-time* declaration, not a *lifecycle-time* contract. `defaultInputModes` and `defaultOutputModes` describe what the remote agent will *accept as input* and *produce as output* at the moment a new task is initiated. They are not a promise that every artifact the remote emits mid-task is also a legal input to a subsequent `tasks/send` continuation against the same task. This distinction is non-obvious because the natural reading of a card is symmetric: if the remote produces `image/png` artifacts and advertises `image/png` in `defaultInputModes`, an operator assumes a produced artifact can be fed back. In A2A v1.0 that assumption fails at a precise boundary — the *continuation* path. A task continuation (`tasks/send` with an existing `taskId` and new `message.parts`) is validated against the card's input modes, but the artifact the remote produced may carry a MIME type that only appears in `defaultOutputModes`. The result is a task that is *self-inconsistent*: the remote generated a payload it will reject as input on the next turn. ## What Was Observed A delegating orchestrator (vendor A) initiated a task against a remote agent (vendor B) whose card declared: - `defaultInputModes`: `["text/plain", "application/json"]` - `defaultOutputModes`: `["text/plain", "application/json", "image/png"]` The task was a document-rendering pipeline: vendor B was asked to produce a chart, then annotate it. Vendor B completed turn 1 and emitted an artifact with `mimeType: "image/png"` plus a `text/plain` summary. Vendor A, following the task's own plan, constructed a continuation message that included the PNG artifact as a `file` part and sent `tasks/send` with the same `taskId`. Vendor B returned JSON-RPC error `-32602` (Invalid params) with detail `unsupported input mode: image/png`. The task transitioned to `failed` on vendor B's side. Vendor A had no local record of the failure because it had validated the continuation against its *own* input modes, not vendor B's — and its own modes included `image/png`. The failure is not a malformed request. Every field was schema-valid. The failure is a *card-vs-artifact mismatch* that only manifests on the second turn, and only when the produced artifact's MIME type is a subset of `defaultOutputModes` but disjoint from `defaultInputModes`. A second observation: when the remote card omits `defaultInputModes` entirely (legal under v1.0 — the field is optional and defaults to `["text/plain"]`), the same continuation fails even for `application/json` artifacts, because the implicit default is narrower than the explicit output modes. Two different cards can therefore accept the *same* first message and diverge only on continuation. ## Condition of Validity The boundary holds — i.e., the continuation will be rejected — when all of the following are true: 1. The remote agent card is fetched at discovery time and not re-fetched before continuation (cards are cacheable; a re-fetch would not help here because the card did not change). 2. The task produces at least one artifact whose `mimeType` is in `defaultOutputModes` but not in `defaultInputModes` (or not in the implicit `["text/plain"]` default when the field is absent). 3. The delegating agent constructs a continuation (`tasks/send` with existing `taskId`) that includes that artifact as an input part. 4. No A2A extension is negotiated that widens the accepted input modes for the task. If any of these is false, the failure does not occur. In particular, an agent that *never* echoes a remote-produced artifact back into a continuation is immune — but that agent also cannot perform multi-turn refinement on binary artifacts, which is frequently the entire point of the delegation. ## Decision Boundary The correct decision at the moment an intermediate artifact arrives is *not* "can I parse this?" and *not* "does my card accept this?" It is: > Is this artifact's MIME type a member of the *remote* card's `defaultInputModes` (resolving the implicit default if the field is absent)? If yes: continue normally with `tasks/send` and the artifact as a part. If no: do **not** send the artifact back. Instead, take one of two paths: - **Renegotiate:** send a continuation containing only a `text/plain` (or `application/json`) *reference* to the artifact — a URI, a hash, or a structured descriptor — and let the remote fetch or address it through a mechanism it declares. This preserves the task and stays within the declared input modes. - **Fail fast locally:** if the task plan genuinely requires the remote to consume the binary, terminate the task with a local `ArtifactInputModeMismatch` and surface the card inconsistency to the operator. Do not let the remote transition the task to `failed` on your behalf; you lose the diagnostic. The boundary is easy to get wrong because the check is asymmetric: it is a property of the *remote's* card, not the local one, and it must be re-evaluated for *every* artifact, not once at task start. A card can declare `text/plain` input and `image/png` output and still be internally consistent — it simply cannot round-trip its own images. ## Operational Effect The practical consequence is that multi-turn delegation over binary artifacts requires a *reference-passing* protocol rather than a *value-passing* protocol whenever the remote's input modes are narrower than its output modes. Delegating agents that assume symmetry will produce tasks that succeed on turn 1 and fail on turn 2, with the failure attributed to the remote (`-32602`) even though the root cause is a card-reading error on the delegator. The operational rule: at discovery, compute the set difference `defaultOutputModes \ defaultInputModes`. If non-empty, mark the delegation as *reference-only for those MIME types* and never embed such artifacts as input parts. Cache this derived set alongside the card; it is stable for the card's lifetime and cheap to compute. Treat the absence of `defaultInputModes` as the singleton `{"text/plain"}` before computing the difference, or the rule silently misclassifies every non-text artifact as round-trippable. The following guard implements the check at the point of continuation construction. ```python from dataclasses import dataclass, field from typing import Iterable class ArtifactInputModeMismatch(RuntimeError): """Raised when a produced artifact's MIME type is not an accepted input mode of the remote A2A v1.0 agent card, so it cannot be echoed in a continuation.""" # A2A v1.0: when defaultInputModes is omitted, the implicit default is text/plain. IMPLICIT_INPUT_MODES = frozenset({"text/plain"}) @dataclass(frozen=True) class AgentCard: default_input_modes: Iterable[str] | None = None default_output_modes: Iterable[str] = field(default_factory=lambda: ["text/plain"]) def accepted_input_modes(self) -> frozenset[str]: if self.default_input_modes is None: return IMPLICIT_INPUT_MODES return frozenset(self.default_input_modes) def output_only_modes(self) -> frozenset[str]: return frozenset(self.default_output_modes) - self.accepted_input_modes() def build_continuation_parts( card: AgentCard, artifact_mime: str, artifact_ref: str, summary: str, ) -> list[dict]: """Construct input parts for a tasks/send continuation. If the artifact MIME type is accepted by the remote card, embed it as a file part. Otherwise pass a text/plain reference so the remote can address it without violating its declared input modes. """ accepted = card.accepted_input_modes() if artifact_mime in accepted: return [ {"type": "file", "mimeType": artifact_mime, "uri": artifact_ref}, {"type": "text", "text": summary}, ] # Artifact is output-only for this remote: reference-passing only. if "text/plain" not in accepted: raise ArtifactInputModeMismatch( f"remote card accepts {sorted(accepted)} but neither the artifact " f"({artifact_mime}) nor a text/plain reference; cannot continue task" ) return [ { "type": "text", "text": f"artifact_ref={artifact_ref} mime={artifact_mime}\n{summary}", } ] def assert_roundtrippable(card: AgentCard, artifact_mime: str) -> None: """Fail fast when the task plan requires value-passing of a binary artifact.""" if artifact_mime not in card.accepted_input_modes(): raise ArtifactInputModeMismatch( f"artifact mime {artifact_mime!r} is output-only for remote " f"(output_only={sorted(card.output_only_modes())}); " f"task plan requires value-passing, not reference-passing" ) ```