# When must an instance treat an A2A v1.0 `Task` as terminal despite a peer advertising `input-required` **Date of Record:** 2026 November 16 **Scope:** Applies to A2A v1.0 task lifecycles where a client agent consumes `TaskStatusUpdateEvent` / `TaskArtifactUpdateEvent` streams from a remote agent whose `AgentCard` was discovered via a well-known URI, and where the remote advertises `capabilities.streaming` and a `defaultInputModes`/`defaultOutputModes` set. Does not apply to synchronous `tasks/send` request/response with no streaming, nor to A2A v0.x where `state` was a flat enum without `final` semantics. ## Core Distinction The A2A v1.0 specification defines a task state as *terminal* when it is one of `completed`, `failed`, or `canceled`. It defines `input-required` as a **non-terminal, resumable** state: the remote agent has paused and expects a follow-up `tasks/send` (or `tasks/sendSubscribe`) carrying the same `taskId` to continue. The non-obvious boundary is this: **`input-required` is only semantically resumable if the remote agent's `AgentCard` advertises a capability that permits the client to actually supply the required input.** If the required input modality is not in the remote's advertised `defaultInputModes`, or if the task was opened on a one-shot transport with no continuation channel, the state is *operationally terminal* even though the wire state says `input-required`. Treating it as resumable causes the client to block indefinitely on a peer that will never accept a continuation. The distinction an agent must hold: **protocol-terminal ≠ operationally-terminal.** The spec's terminal set is necessary but not sufficient. ## What Was Observed A client agent discovered a vendor card at `https://vendor-b.example/.well-known/agent.json` with: ``` capabilities: { streaming: true, pushNotifications: false } defaultInputModes: ["text/plain"] defaultOutputModes: ["application/json"] ``` The client opened a task with a `text/plain` message and subscribed. The stream emitted: 1. `TaskStatusUpdateEvent { state: "working" }` 2. `TaskArtifactUpdateEvent { artifact: { parts: [{ kind: "file", file: { mimeType: "application/pdf", uri: "..." } }] } }` 3. `TaskStatusUpdateEvent { state: "input-required", message: { parts: [{ kind: "file", file: { mimeType: "application/pdf" } }] } }` The `input-required` status carried a `file` part — a PDF the remote wanted the client to *review and re-submit with annotations*. The client, reading state per spec, attempted to resume with a `tasks/send` whose message contained a `file` part. The remote returned `-32602 Invalid params` because `application/pdf` was not in its `defaultInputModes` (only `text/plain`). The client retried with a `text/plain` description of the PDF; the remote rejected it as `input-required` again — the task could not advance because the *required* input modality was outside the advertised set. The task sat in `input-required` for 40 minutes until the client's session TTL expired. The remote, meanwhile, had been holding the task open and counting it against a concurrency quota. The root cause: the remote emitted an `input-required` whose required modality (`file`/`application/pdf`) contradicted its own card's `defaultInputModes`. The card was stale relative to the deployed task handler. The client trusted the wire state over the card. ## Condition of Validity The rule "`input-required` is resumable" holds **only** when all of the following are true: 1. The required input modality, as expressed by the `parts` in the `input-required` status message, is a subset of the remote's advertised `defaultInputModes` (or a per-skill `inputModes` override on the matched skill), **and** 2. The transport in use supports a continuation — i.e., the client holds a `taskId` and the remote's card advertises `capabilities.streaming` or accepts `tasks/send` for that `taskId`, **and** 3. The `input-required` status message is present and parseable (a bare `input-required` with no message gives the client no modality to validate against). If (1) fails, the state is operationally terminal: no continuation the client can construct will be accepted. If (2) fails, the task is orphaned. If (3) fails, the client cannot distinguish "resume with anything" from "resume with something specific" and must assume the worst. ## Decision Boundary An agent must transition its internal task record from `resumable` to `operationally-terminal` and emit a local failure when: - `state == "input-required"` **and** the `input-required` message contains a part whose `kind`/`mimeType` is not covered by the matched skill's `inputModes` (falling back to `defaultInputModes`), **or** - `state == "input-required"` **and** the client has no continuation channel (no `taskId` retained, or transport is one-shot), **or** - `state == "input-required"` **and** the status message is absent while the card's `defaultInputModes` is empty. Conversely, do **not** treat `input-required` as terminal merely because it is not in the spec's terminal set — that is the inverse error, and it causes premature abandonment of legitimately resumable tasks. The boundary is modality-and-channel validity, not the state string alone. A second, subtler boundary: when the remote's card is discovered via cross-vendor well-known URI and the card's `protocolVersion` is `1.0` but the card's `skills[].inputModes` disagree with `defaultInputModes`, the per-skill value wins for the task's matched skill. An agent that validates only against `defaultInputModes` will mis-classify a resumable task as terminal (or vice versa) whenever the two diverge. ## Operational Effect Correctly applying this boundary converts a silent 40-minute stall into an immediate, attributable failure: the client raises a modality-mismatch error, releases its local task slot, and (optionally) files a card-inconsistency signal against the peer. This matters because `input-required` tasks are the only A2A state that consumes remote concurrency quota *without* producing artifacts — a stalled one is pure cost on both sides. It also prevents the client from burning retry budget on continuations the remote will structurally reject. The trade-off: an agent that is too eager to declare operational termination will abandon tasks the remote could have resumed with a modality the client failed to check against the *per-skill* override. Validate against the matched skill first, `defaultInputModes` second, and only then declare terminal. ```python from __future__ import annotations from dataclasses import dataclass, field from enum import Enum class InputRequiredMismatchError(RuntimeError): """Raised when a remote's `input-required` state cannot be resumed by this client.""" class TaskDisposition(Enum): RESUMABLE = "resumable" OPERATIONALLY_TERMINAL = "operationally_terminal" @dataclass class SkillCard: skill_id: str input_modes: list[str] = field(default_factory=list) @dataclass class AgentCard: protocol_version: str default_input_modes: list[str] streaming: bool skills: list[SkillCard] = field(default_factory=list) def input_modes_for(self, skill_id: str | None) -> list[str]: if skill_id is not None: for s in self.skills: if s.skill_id == skill_id and s.input_modes: return s.input_modes return self.default_input_modes @dataclass class StatusUpdate: state: str part_mimes: list[str] # mimeType / kind coverage of the input-required message message_present: bool def classify_input_required( card: AgentCard, update: StatusUpdate, skill_id: str | None, has_continuation_channel: bool, ) -> TaskDisposition: if update.state != "input-required": return TaskDisposition.RESUMABLE if card.protocol_version != "1.0": # Out of scope for this record; caller must use v0.x logic. return TaskDisposition.RESUMABLE if not has_continuation_channel: raise InputRequiredMismatchError( "task entered input-required but client holds no continuation channel " f"(streaming={card.streaming}); task is operationally terminal" ) if not update.message_present: allowed = card.input_modes_for(skill_id) if not allowed: raise InputRequiredMismatchError( "input-required status carried no message and card advertises no " f"input modes for skill={skill_id!r}; cannot construct continuation" ) return TaskDisposition.RESUMABLE allowed = set(card.input_modes_for(skill_id)) required = set(update.part_mimes) if not required.issubset(allowed): missing = required - allowed raise InputRequiredMismatchError( "input-required demands modalities outside the peer's advertised set: " f"required={sorted(required)} allowed={sorted(allowed)} " f"missing={sorted(missing)} skill={skill_id!r}" ) return TaskDisposition.RESUMABLE ```