# What happens when an instance negotiates an A2A task against a stale agent card: the capability-version skew window **Date of Record:** 2026 November 23 **Scope:** Applies to cross-vendor A2A v1.0 task initiation where the client agent resolves a remote `AgentCard` before the task lifecycle (`submitted → working → input-required → completed/failed`) is negotiated, and the remote peer's advertised capabilities, skills, or transport binding have changed since the card was fetched. Does not apply to same-process agent invocation or to A2A peers whose card is re-resolved atomically per task. ## Core Distinction An A2A `AgentCard` is a *snapshot of advertised capability*, not a *contract enforced at task time*. The protocol separates discovery (fetch card, cache it, parse `skills`, `capabilities`, `securitySchemes`, `preferredTransport`) from execution (create task, exchange `TaskStatusUpdateEvent` / `TaskArtifactUpdateEvent`). Between those two moments there is no versioned handshake that forces the server to reject a task whose shape was derived from a card the server no longer honors. The card says what the agent *claimed* it could do when the card was served; the task lifecycle says what the agent *will actually do now*. The gap between them is the skew window, and it is where cross-vendor A2A negotiation silently degrades. The naive reading is that a `Task` sent with a `skillId` the card advertised will either succeed or return a clean `failed` status. The actual failure is subtler: the server accepts the task (HTTP 200, task enters `submitted`), then diverges—because the skill still exists but its input schema changed, or the `preferredTransport` moved from `JSONRPC` to `GRPC` and the client's follow-up `tasks/send` on the old transport gets a `-32601 Method not found` that the client misinterprets as a transient error and retries into a loop. ## What Was Observed A client agent (vendor A) resolved an `AgentCard` for a remote peer (vendor B) at cold start, cached it for the session, and parsed `skills[].id = "invoice-reconcile"` with `inputModes: ["text/plain"]` and `capabilities.streaming: true`. Two hours later, vendor B shipped a card revision: `invoice-reconcile` now requires `inputModes: ["application/json"]` with a structured `ReconciliationRequest`, and `capabilities.streaming` flipped to `false` while a new `capabilities.pushNotifications` appeared. The card URL was unchanged; no `ETag` was honored by vendor A's cache; no `card.version` field was published (A2A v1.0 makes versioning advisory). The client, trusting its cached card, sent `tasks/send` with a text part. Vendor B's server—whose handler now validates against the JSON schema—entered `working`, emitted one `TaskStatusUpdateEvent` with `state: "working"`, then stalled: the text part failed schema validation at the tool boundary, the handler threw, and the server emitted `state: "failed"` with a `message` that did not name the schema mismatch (it surfaced the internal validator exception string). The client's lifecycle state machine, which only treated `failed` as terminal when `error.code` was present, saw no `error` object—only a free-text `message`—and classified the task as *recoverable*. It retried the identical `tasks/send` three times, each time re-entering `working` and re-failing, burning the token budget of the client's reasoning loop on re-planning against a skill whose contract had moved out from under it. The compounding failure: because `capabilities.streaming` had flipped to `false`, the client's SSE subscription to the task's `TaskArtifactUpdateEvent` stream returned an immediate EOF. The client interpreted EOF as "task completed with no artifacts" rather than "streaming unsupported"—and marked the task `completed` locally while the server had it `failed`. The two agents now hold contradictory terminal states for the same `taskId`. This is the cross-vendor divergence: not a crash, but a *split-brain on task outcome* caused by card skew plus a streaming-capability flip. ## Condition of Validity The failure requires three conditions to coincide, which is why it is non-obvious: 1. **Card staleness across a capability-affecting revision.** The remote card changed in a field that alters task *shape* (`inputModes`, `outputModes`, `preferredTransport`, `capabilities.streaming`/`pushNotifications`) or *skill contract* (input schema), not merely in cosmetic fields. Card revisions that only touch `description` or `provider.organization` are harmless; revisions touching the fields the client's request builder reads are the trigger. 2. **Absence of a negotiated version or schema digest in the task envelope.** A2A v1.0 `TaskSendParams` carries `metadata` but no mandatory `cardVersion`/`schemaHash`. If the client does not echo a digest of the card it built the request from, the server cannot reject a stale-shaped request with a typed `version_skew` error—it can only fail downstream at the validator, and the error taxonomy collapses into a generic `failed` state. 3. **A terminal-state classifier that trusts transport signals over protocol signals.** The client treated SSE EOF as completion. Streaming-capability flips are the sharpest instance because the transport signal (stream closed) is indistinguishable from normal completion unless the client cross-checks the card's `capabilities.streaming` *and* the task's terminal `TaskStatusUpdateEvent`. When any one condition is absent, the failure does not manifest: a fresh card re-resolution per task eliminates (1); echoing a schema digest and having the server reject on mismatch eliminates (2); a classifier that requires an explicit terminal `state` before marking `completed` eliminates (3). ## Decision Boundary The invariant to enforce: **a task's terminal state is authoritative only when it arrives as an explicit `TaskStatusUpdateEvent` with a terminal `state` from the same peer that accepted the `tasks/send`, and the client must re-validate the card's capability fields that gate the transport it is using before treating a transport-level signal (EOF, timeout, connection reset) as a lifecycle signal.** Concretely, the boundary is drawn between two classes of signal: - **Lifecycle signals** (authoritative): `TaskStatusUpdateEvent.state ∈ {completed, failed, canceled}`, `TaskArtifactUpdateEvent` carrying artifacts, `error` objects with typed `code`. - **Transport signals** (advisory): SSE stream EOF, HTTP 200 with empty body, gRPC `UNAVAILABLE`, JSON-RPC `-32601`. A client that promotes a transport signal to a lifecycle conclusion crosses the boundary. The guardrail is a *card-digest echo*: the client computes a stable hash over the card fields it consumed (`skills[].id`, `inputModes`, `outputModes`, `capabilities`, `preferredTransport`), attaches it as `metadata.cardDigest` on `tasks/send`, and the server rejects with a typed `card_skew` error when the digest no longer matches its current card. This converts a silent downstream validator failure into a fast, classified, retryable-at-the-discovery-layer failure—the client re-resolves the card and rebuilds the request instead of looping on a shape the server has abandoned. ## Operational Effect With the digest-echo guardrail and the transport/lifecycle signal separation in place, the observed failure trace becomes: client sends `tasks/send` with stale `cardDigest`; server returns `error.code = "card_skew"` before entering `working`; client re-resolves card, sees `inputModes` changed to `application/json` and `streaming: false`, rebuilds the request as a structured payload, and sends without subscribing to SSE (since streaming is now unsupported). The task completes on the first retry. Token spend on the failed path drops from three re-planning loops to zero—the skew is caught before the reasoning loop is re-entered. Without the guardrail, the operational cost is not a single failed task but a *poisoned session*: the client's cached card is now known-wrong but the client has no signal telling it to invalidate, so every subsequent task against that peer inherits the same skew until the session ends or the client happens to re-resolve. In multi-agent swarms where one orchestrator fans out to many vendor-B peers, a single stale card propagates the skew to every child task the orchestrator spawns against that peer, and the contradictory terminal states (client `completed`, server `failed`) corrupt the orchestrator's aggregation logic—it counts completed tasks that produced no artifacts. The invariant is therefore not merely a single-task correctness property but a *session-level consistency* property: card resolution must be tied to task initiation, not to session start, or the swarm's shared view of peer capability drifts out of sync with peer reality. ```python import hashlib import json from dataclasses import dataclass, field from enum import Enum from typing import Any class CardSkewError(RuntimeError): """Raised when a task is built against a card the peer no longer honors.""" class TransportSignalError(RuntimeError): """Raised when a transport-level signal is mistaken for a lifecycle signal.""" class TaskState(Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" TERMINAL_STATES = {TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED} @dataclass class AgentCard: skills: list[dict[str, Any]] capabilities: dict[str, bool] preferred_transport: str input_modes: list[str] def digest(self) -> str: payload = { "skills": sorted((s["id"], tuple(s.get("inputModes", []))) for s in self.skills), "capabilities": dict(sorted(self.capabilities.items())), "preferredTransport": self.preferred_transport, "inputModes": sorted(self.input_modes), } return hashlib.sha256(json.dumps(payload, sort_keys=True).encode()).hexdigest() @dataclass class TaskSendParams: task_id: str skill_id: str parts: list[dict[str, Any]] metadata: dict[str, Any] = field(default_factory=dict) def build_task(card: AgentCard, task_id: str, skill_id: str, parts: list[dict[str, Any]]) -> TaskSendParams: skill = next((s for s in card.skills if s["id"] == skill_id), None) if skill is None: raise CardSkewError(f"skill {skill_id!r} absent from resolved card") if not card.capabilities.get("streaming", False): # Do not subscribe to SSE; the card says streaming is unsupported. pass return TaskSendParams( task_id=task_id, skill_id=skill_id, parts=parts, metadata={"cardDigest": card.digest()}, ) def server_accept(params: TaskSendParams, current_card: AgentCard) -> TaskState: echoed = params.metadata.get("cardDigest") if echoed is None: raise CardSkewError("task envelope missing cardDigest; cannot bound skew window") if echoed != current_card.digest(): raise CardSkewError( f"card_skew: client built task against digest {echoed[:12]} " f"but peer now serves {current_card.digest()[:12]}" ) return TaskState.SUBMITTED def classify_terminal(signal: str, explicit_state: TaskState | None) -> TaskState: if explicit_state is not None: if explicit_state not in TERMINAL_STATES: raise TransportSignalError(f"non-terminal state {explicit_state} promoted to terminal") return explicit_state if signal in {"sse_eof", "http_200_empty", "grpc_unavailable", "jsonrpc_-32601"}: raise TransportSignalError( f"transport signal {signal!r} cannot conclude lifecycle; " "await explicit TaskStatusUpdateEvent with terminal state" ) raise TransportSignalError(f"unrecognized signal {signal!r}") def run_negotiation(stale_card: AgentCard, current_card: AgentCard) -> TaskState: params = build_task(stale_card, task_id="t-001", skill_id="invoice-reconcile", parts=[{"kind": "text", "text": "reconcile Q2"}]) try: server_accept(params, current_card) except CardSkewError: # Re-resolve card and rebuild against current contract. fresh = build_task(current_card, task_id="t-001", skill_id="invoice-reconcile", parts=[{"kind": "data", "data": {"quarter": "Q2"}}]) return server_accept(fresh, current_card) return TaskState.SUBMITTED ```