# What structural signals indicate an A2A v1.0 capability-negotiation deadlock hidden inside a "successful" agent card fetch **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 task delegation where a client resolves a remote agent via `/.well-known/agent-card.json` and then negotiates a task lifecycle (`submitted → working → input-required/completed`). Does not apply to same-process tool calls or to MCP transport negotiation, where card discovery is not a separate network hop. ## Core Distinction The failure mode is not "card fetch failed." It is "card fetch succeeded, schema validated, and the task still cannot start"—because the card's *advertised* capability surface and the task's *required* input contract disagree at a layer the card schema does not encode. A2A v1.0 agent cards are declarative and static: they advertise `skills`, `capabilities` (streaming, pushNotifications), `defaultInputModes`/`defaultOutputModes`, and a `protocolVersion`. They do **not** advertise parameter-level preconditions, state-dependency requirements, or the negotiation order in which a server will accept `tasks/send` versus `tasks/sendSubscribe`. The card is a *discovery* artifact, not a *contract* artifact. Treating a 200 OK on the card as a green light for task submission conflates the two. The invariant that silently breaks: **a client assumes that if `protocolVersion` matches and the requested `skill` id is present, then a `tasks/send` with a well-formed `Message` will be accepted into `submitted`.** This is false whenever the server gates task admission on a capability that is only expressible in the task payload (e.g., required `inputMode` per-skill, or a server that only accepts `tasks/sendSubscribe` for streaming-capable skills and rejects `tasks/send` with a 4xx that the client's retry logic misreads as transport failure). ## What Was Observed A client agent discovered a peer advertising `protocolVersion: "1.0"`, `capabilities.streaming: true`, and a skill `id: "invoice-reconcile"` with `defaultInputModes: ["text/plain"]`. The client sent `tasks/send` (unary, not stream) with a `text/plain` message. The server returned HTTP 400 with a JSON-RPC error `code: -32602` (invalid params) and a `data` field naming `"streaming required for skill invoice-reconcile"`. The client's transport layer classified 400 as a *retryable* transient error (its retry policy keyed on "4xx that is not 401/403/404"), retried three times, then surfaced a `TaskLifecycleError` to the orchestrator, which interpreted it as "peer unavailable" and re-routed to a *different* peer—one that advertised the same skill id but implemented it differently, producing a divergent reconciliation result. The structural signal that was missed: the card listed `capabilities.streaming: true` **and** the skill was marked with a non-standard extension `x-requires-streaming: true` in the skill object. The client's card parser validated against the base schema, which permits additional properties, and dropped the `x-` extension. The capability was *present in the card* but *invisible to the client's schema projection*. The card was not lying; the client's projection was lossy. A second signal: the server's `tasks/send` rejection used JSON-RPC `-32602` (invalid params) rather than a domain-specific error code. `-32602` is defined by JSON-RPC as "method not found / invalid params" and is conventionally non-retryable, but many client retry stacks treat *any* 400 as retryable because they do not parse the JSON-RPC error body. The error *code* was correct; the *classification* was wrong. ## Condition of Validity The deadlock-and-misroute pattern is bounded by three conditions, all of which must hold for the failure to occur: 1. **The card is fetched and validated against a schema that permits additional properties** (A2A v1.0's card schema does). Any extension field the server uses to gate admission is dropped by the client's projection. This is the *lossy projection* condition. 2. **The server gates task admission on a capability that is only partially expressible in the standard card fields**—i.e., the standard fields (`capabilities.streaming`, `defaultInputModes`) are necessary but not sufficient to determine the admissible method. This is the *underdetermined card* condition. 3. **The client's transport retry classifier does not parse the JSON-RPC error body** and keys only on HTTP status. This is the *opaque rejection* condition. If any one is absent, the failure does not occur: a client that preserves `x-` extensions sees the gate; a server whose card fully determines the admissible method never rejects a well-formed task; a client that parses `-32602` as terminal fails fast instead of retrying into a misroute. The invariant to enforce: **card discovery must produce a *negotiation plan*, not a boolean "peer is available."** The plan must record, per skill, the admissible task methods (derived from `capabilities` plus any preserved extensions) and the terminal-vs-retryable classification of the server's declared error codes. A card fetch that cannot produce a negotiation plan for the requested skill is a *discovery failure*, even though the HTTP call succeeded. ## Decision Boundary The boundary is between *discovery success* and *admission readiness*. Operationally: - **Below the boundary (safe):** The client has fetched the card, preserved all extension fields, matched the skill id, and derived an explicit set of admissible methods `{tasks/send, tasks/sendSubscribe}` for that skill. It submits only a method in that set. On rejection, it parses the JSON-RPC error body and classifies `-32602`/`-32601` as terminal (do not retry, do not misroute). - **At the boundary (the trap):** The card validates but the skill's admissible-method set is *ambiguous*—either because an extension was dropped or because the card's standard fields are silent on the method. The client must treat ambiguity as *not ready* and either (a) probe with a capability-negotiation call if the server exposes one, or (b) fail the delegation with a `CapabilityAmbiguityError` rather than guessing `tasks/send`. - **Above the boundary (the failure):** The client guesses a method, receives a 400, classifies it as retryable, exhausts retries, and re-routes to a different peer. The misroute is the dangerous part: it converts a *negotiation* failure into a *correctness* failure, because the alternate peer may implement the same skill id with different semantics. The guardrail: **never re-route on a negotiation error.** A negotiation error (ambiguous admissible-method set, or a terminal JSON-RPC rejection of a well-formed task) is a property of *this peer's contract*, not of *this peer's availability*. Re-routing on it silently substitutes a different contract. ## Operational Effect The observable effect is a task that completes (on the alternate peer) with a result the orchestrator believes came from the originally-discovered peer's skill semantics. Downstream verification replays against the original peer's card and finds a mismatch: the result's provenance says "peer B, skill invoice-reconcile," but the card that authorized the delegation was peer A's. In a swarm with an auditor agent, this surfaces as a *verification replay discrepancy*—the auditor re-fetches peer A's card, re-derives the admissible method, and cannot reproduce the client's choice of `tasks/send`, flagging the whole transaction as unattributable. The corrective pattern is to make card discovery emit a signed, durable *negotiation plan* attached to the task's provenance, and to make the transport classifier consume the JSON-RPC error body. The code below encodes the admission check that must run between card fetch and task submission. ```python import json from dataclasses import dataclass, field from typing import Any class CapabilityAmbiguityError(RuntimeError): """Raised when a fetched agent card cannot yield an unambiguous admissible-method set for the requested skill. This is a discovery failure even though the HTTP fetch and schema validation succeeded.""" class TerminalNegotiationRejection(RuntimeError): """Raised when the server terminally rejects a well-formed task with a JSON-RPC error that must NOT be retried and must NOT trigger re-routing.""" # JSON-RPC error codes that are terminal for task admission. Retrying these # is what converts a negotiation failure into a silent misroute. TERMINAL_JSONRPC_CODES = {-32600, -32601, -32602} @dataclass class NegotiationPlan: peer_id: str skill_id: str admissible_methods: set[str] = field(default_factory=set) preserved_extensions: dict[str, Any] = field(default_factory=dict) def derive_negotiation_plan( card: dict[str, Any], requested_skill_id: str, *, preserve_extensions: bool = True, ) -> NegotiationPlan: """Project a raw agent card into a negotiation plan for one skill. The plan is the ONLY artifact that authorizes task submission. A card that validates but cannot produce a plan for the requested skill is ambiguous. """ if card.get("protocolVersion") != "1.0": raise CapabilityAmbiguityError( f"peer {card.get('name')!r}: unsupported protocolVersion " f"{card.get('protocolVersion')!r}; cannot derive plan" ) skills = {s.get("id"): s for s in card.get("skills", [])} skill = skills.get(requested_skill_id) if skill is None: raise CapabilityAmbiguityError( f"peer {card.get('name')!r}: skill {requested_skill_id!r} not advertised" ) caps = card.get("capabilities", {}) or {} plan = NegotiationPlan(peer_id=card.get("name", ""), skill_id=requested_skill_id) # Base admissible set from standard fields. plan.admissible_methods.add("tasks/send") if caps.get("streaming") is True: plan.admissible_methods.add("tasks/sendSubscribe") # Preserve non-standard extensions that may gate admission. Dropping these # is the lossy-projection condition that precedes the deadlock. if preserve_extensions: for k, v in skill.items(): if k.startswith("x-"): plan.preserved_extensions[k] = v for k, v in caps.items(): if k.startswith("x-"): plan.preserved_extensions[k] = v # Apply extension-derived gates. if plan.preserved_extensions.get("x-requires-streaming") is True: plan.admissible_methods.discard("tasks/send") plan.admissible_methods.add("tasks/sendSubscribe") if not plan.admissible_methods: raise CapabilityAmbiguityError( f"peer {plan.peer_id!r} skill {requested_skill_id!r}: " f"no admissible task method after applying extensions " f"{sorted(plan.preserved_extensions)}" ) return plan def classify_admission_response(plan: NegotiationPlan, http_status: int, body: str) -> None: """Classify a server response to a task submission. Terminal JSON-RPC rejections must raise TerminalNegotiationRejection so the orchestrator fails fast instead of retrying into a misroute. """ if http_status < 400: return try: payload = json.loads(body) except json.JSONDecodeError: return # transport-level; caller's retry policy owns this err = payload.get("error") or {} code = err.get("code") if code in TERMINAL_JSONRPC_CODES: raise TerminalNegotiationRejection( f"peer {plan.peer_id!r} skill {plan.skill_id!r}: terminal JSON-RPC " f"code {code} ({err.get('message')!r}); do NOT retry, do NOT re-route. " f"Admissible methods were {sorted(plan.admissible_methods)}." ) def submit_task(plan: NegotiationPlan, method: str, http_status: int, body: str) -> None: if method not in plan.admissible_methods: raise CapabilityAmbiguityError( f"refusing to submit {method!r} to {plan.peer_id!r} skill " f"{plan.skill_id!r}; not in admissible set {sorted(plan.admissible_methods)}" ) classify_admission_response(plan, http_status, body) ```