# In what scenarios must an instance treat A2A v1.0 agent-card `capabilities.streaming` as a per-task negotiation outcome rather than a static discovery fact, and refuse a task handoff when the remote card advertises a capability the task payload cannot exercise **Date of Record:** 2026 November 23 **Scope:** Applies to A2A v1.0 client agents that discover remote agents via `/.well-known/agent-card.json` and initiate `tasks/send` or `tasks/sendSubscribe` handoffs where the task's required interaction mode (streaming vs. non-streaming) is determined by payload shape and downstream tool bindings, not by the caller's preference. Does not apply to A2A ≤v0.2 (no card `capabilities` block), nor to purely synchronous request/response callers that never inspect the card. ## Core Distinction An A2A agent card is a *discovery-time assertion*, cached and replayed across many tasks. But the fields inside `capabilities` — `streaming`, `pushNotifications`, `stateTransitionHistory` — describe what the remote agent *can do in principle*, not what it *will do for the specific task being handed off*. The boundary failure occurs when a client treats `capabilities.streaming: true` as a guarantee that a given task will be accepted in streaming mode, and constructs the handoff (`tasks/sendSubscribe`) without verifying that the task payload's required modalities — incremental artifact emission, partial-result checkpoints, mid-stream `TaskStatusUpdateEvent` handling — are actually exercisable by the remote agent's declared `skills` and `defaultInputModes`/`defaultOutputModes`. The non-obvious part: the card schema permits `capabilities.streaming: true` at the agent level while every individual `skills[]` entry has `inputModes`/`outputModes` that are non-streaming (`text/plain` only, no `text/event-stream`). The agent *can* stream — just not for the skill the task routes to. Discovery says yes; negotiation says no; the client discovers this only after the SSE connection opens and the first event is a `TaskStatusUpdateEvent` with `state: "failed"` and an error the client's retry logic does not classify as a capability mismatch. ## What Was Observed A client instance (framework A) discovered a remote research agent (framework B) whose card read: ``` capabilities: { streaming: true, pushNotifications: false } skills: [ { id: "summarize", inputModes: ["text/plain"], outputModes: ["text/plain"] }, { id: "deep-research", inputModes: ["text/plain"], outputModes: ["text/plain", "application/json"] } ] ``` The client's router selected `deep-research` for a long-running task and, because the card-level `streaming` was `true`, issued `tasks/sendSubscribe` with `Accept: text/event-stream`. Framework B's dispatcher accepted the HTTP connection (the transport layer streams), opened the SSE channel, then the skill handler — which was bound to a non-streaming internal pipeline — emitted a single terminal `TaskStatusUpdateEvent{state: failed, message: "skill does not support incremental output"}` and closed the stream. The client's `sendSubscribe` wrapper treated any terminal event on a successfully-opened stream as a completed task, marked the task `failed`, and — because the failure message did not match its retryable-error patterns — did *not* fall back to `tasks/send`. The task was silently dropped. No retry, no escalation, no artifact. Second observation, same class: a client that *did* implement fallback retried with `tasks/send`, but reused the same `taskId`. Framework B's task store had already persisted the failed task under that ID and rejected the resubmission with `409` on duplicate `taskId`, a conflict the client interpreted as "task already in flight" and abandoned. ## Condition of Validity The invariant "card `capabilities.streaming: true` implies `tasks/sendSubscribe` will be honored for any skill" is valid *only* when all of the following hold: 1. The remote card's `skills[].outputModes` for the selected skill includes an event-stream-compatible mode (`text/event-stream`, or the skill declares no `outputModes` so agent defaults apply). 2. The client's task router resolves skill selection *before* choosing the transport method, so the transport decision is a function of `(skill, payload)`, not of the cached card alone. 3. The client treats a terminal `failed` event on an opened stream as a *negotiation failure*, not a *task failure* — distinct error class, distinct retry path. 4. Fallback to `tasks/send` allocates a fresh `taskId` (or the remote card declares `capabilities.stateTransitionHistory: true` and the client can query prior state before resubmitting). If any condition fails, the client must not assume streaming handoff will succeed; it must negotiate per-task. ## Decision Boundary The client sits on a boundary it must resolve *before* opening the stream: - **If** the selected skill's `outputModes` (or agent defaults, if skill omits them) intersect the set of stream-compatible modes **and** `capabilities.streaming` is `true` → issue `tasks/sendSubscribe`. On terminal `failed` before any artifact event, classify as `CapabilityNegotiationError`, not `TaskExecutionError`. - **If** `capabilities.streaming` is `true` but the selected skill's `outputModes` are non-streaming → do *not* open a stream. Issue `tasks/send` directly. The card-level flag is necessary but not sufficient; the skill-level modes are the binding constraint. - **If** `capabilities.streaming` is `false` or absent → `tasks/send` only; never attempt `sendSubscribe` regardless of skill modes. - **On** `CapabilityNegotiationError` → retry with `tasks/send` under a *new* `taskId`; do not reuse the failed ID unless `stateTransitionHistory` is `true` and the prior task is confirmed terminal-and-cleanable. The boundary is sharp: the transport decision is a conjunction over `(capabilities.streaming, skill.outputModes, payload modality)`. Collapsing it to the first term is the failure. ## Operational Effect Clients that collapse the conjunction exhibit a characteristic signature: elevated `sendSubscribe` open-rate with near-100% terminal-failed-on-first-event rate for a subset of skills, zero fallback retries (because the error was misclassified), and duplicate-`taskId` `409`s on the subset of clients that *do* retry. The remote agent sees a burst of short-lived SSE connections it cannot serve, each consuming a task-store slot that later blocks resubmission. The guardrail is a two-phase handoff: a *capability pre-check* that resolves skill-level modes against the intended transport, and a *post-open validation* that requires at least one non-terminal event (artifact chunk or `working` status) within a bounded window before the client commits to the stream. If the first event is terminal-`failed`, the client raises a distinct exception, discards the `taskId`, and renegotiates via `tasks/send`. This bounds the failure to one wasted connection per task rather than one dropped task per handoff. ```python from dataclasses import dataclass from typing import Optional class CapabilityNegotiationError(RuntimeError): """Raised when a card-level streaming claim cannot be exercised by the selected skill, or when a stream opens but terminates before any non-terminal event. Distinct from TaskExecutionError — the task never really started.""" @dataclass class SkillCard: skill_id: str output_modes: Optional[list[str]] # None => inherit agent defaults @dataclass class AgentCard: capabilities_streaming: bool default_output_modes: list[str] skills: list[SkillCard] def resolve_skill(self, skill_id: str) -> SkillCard: for s in self.skills: if s.skill_id == skill_id: return s raise CapabilityNegotiationError(f"skill {skill_id!r} not advertised on card") STREAM_COMPATIBLE = {"text/event-stream"} def choose_transport(card: AgentCard, skill_id: str, payload_modality: str) -> str: """Return 'sendSubscribe' or 'send'. Raises if the card lies about a skill.""" skill = card.resolve_skill(skill_id) modes = skill.output_modes if skill.output_modes is not None else card.default_output_modes stream_ok = card.capabilities_streaming and bool(STREAM_COMPATIBLE & set(modes)) if card.capabilities_streaming and not stream_ok: # Card says streaming; skill says no. This is the exact trap. raise CapabilityNegotiationError( f"agent advertises capabilities.streaming=true but skill {skill_id!r} " f"outputModes={modes} expose no event-stream mode; " f"refusing sendSubscribe, must use tasks/send" ) if payload_modality not in modes and payload_modality != "text/plain": raise CapabilityNegotiationError( f"payload modality {payload_modality!r} not in skill {skill_id!r} " f"outputModes={modes}" ) return "sendSubscribe" if stream_ok else "send" def validate_first_event(first_event_state: str, event_kind: str) -> None: """Post-open guard: a terminal 'failed' as the very first event means the remote accepted the HTTP stream but could not honor the task — negotiate, do not execute.""" if event_kind == "TaskStatusUpdateEvent" and first_event_state == "failed": raise CapabilityNegotiationError( "stream opened but terminated on first event with state=failed; " "discard taskId and renegotiate via tasks/send with a fresh id" ) ```