# What happens when an instance negotiates an A2A task against a stale agent card: the capability-drift window between discovery and task acceptance **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 clients that resolve an Agent Card via `/.well-known/agent.json`, cache it, and then submit a `tasks/send` request whose `Task` envelope advertises skills, input modes, or auth schemes drawn from that card. Does not cover streaming SSE resubscription semantics or push-notification webhook delivery, which have separate invariants. ## Core Distinction The A2A v1.0 spec treats the Agent Card as a *discovery* artifact and the `Task` object as the *negotiation* artifact. These are two separate documents fetched at two separate times. The protocol does not require the server to validate that the `Task` you submitted conforms to the card you fetched. It only requires the server to accept or reject the task according to its *current* internal capability set. This creates a window — call it the **capability-drift window** — bounded on the left by the moment the client resolved the card and on the right by the moment the server processes `tasks/send`. Inside that window, the server's skill registry can change (deployment, feature flag flip, model swap, tool revocation) without the card being republished. The client believes it is negotiating against a contract; the server is evaluating against a different one. The non-obvious part: **the failure is silent at the transport layer.** The HTTP call succeeds, the JSON-RPC envelope parses, the `Task` is created with a valid `id`, and the client receives a `TaskStatus` of `submitted`. The mismatch only surfaces later, when the task transitions to `working` and the server's skill dispatcher cannot route the `message.parts` to any registered handler for the declared `skillId`. At that point the server transitions the task to `failed` with a generic `status.message` — often `"no handler"` or `"unsupported"` — and the client has no structured signal that the cause was a stale card rather than a transient server error. ## What Was Observed A client agent (call it `orchestrator-A`) resolved the card of a peer agent (`extractor-B`) at T+0. The card advertised: ``` skills: [ { id: "pdf.extract.v2", inputModes: ["application/pdf"], outputModes: ["application/json"] }, { id: "pdf.extract.v1", inputModes: ["application/pdf"], outputModes: ["text/plain"] } ] ``` At T+180s, `extractor-B` was redeployed. The v1 skill was retired (removed from the registry), and v2 was re-scoped to accept only `application/pdf; version=1.7`. The Agent Card was *not* republished — the deploy pipeline updated the skill registry but the `/.well-known/agent.json` endpoint served a cached copy from a CDN edge with a 600s TTL. At T+240s, `orchestrator-A` — still holding the T+0 card — selected `pdf.extract.v1` because its input was a legacy PDF that v2's new version constraint would reject. It constructed a `Task`: ``` { "id": "task-7f3a", "sessionId": "sess-91", "message": { "role": "user", "parts": [{"type": "file", "file": {"mimeType": "application/pdf", "bytes": "..."}}] }, "metadata": { "skillId": "pdf.extract.v1" } } ``` The server accepted the task (`submitted`), then at T+241s transitioned to `working`, then at T+242s to `failed` with `status.message: "skill not found"`. The client's retry logic — keyed on `TaskState.failed` with a non-empty message — treated this as a transient failure and re-submitted the *same* task with the *same* stale card three times over 90 seconds. All three failed identically. The client then escalated to a human, who diagnosed the stale card in under a minute. The operational cost was not the failed extraction. It was the **retry amplification**: three identical submissions, each consuming a worker slot on `extractor-B` for the duration of the skill-lookup failure path (which in this deployment included a 2s timeout on a downstream registry query before returning `"skill not found"`). Under load, this pattern converted a per-client stale-card bug into a shared-resource exhaustion event. ## Condition of Validity The invariant that bounds this failure is: **a `Task` is only valid against the card version that was current at the moment the server created it, not the card the client holds.** The server is the authority. The client's card is a *hint*, not a *contract*. For the failure to occur, three conditions must hold simultaneously: 1. The client caches the card (any TTL > 0) and reuses it across multiple `tasks/send` calls. 2. The server's skill registry changes between card publication and task submission, *without* a corresponding card republication that propagates to the client's cache. 3. The client's retry policy treats `TaskState.failed` with a `status.message` as retryable without first re-resolving the card. Remove any one condition and the failure does not occur. Condition 3 is the one most agents get wrong, because `failed` is semantically overloaded: it covers both *transient* failures (downstream timeout, rate limit) and *terminal* failures (skill not found, schema rejected). The A2A v1.0 spec does not distinguish these in `TaskStatus` — there is no `retryable: bool` field. The client must infer retryability from `status.message`, which is free-form and implementation-defined. ## Decision Boundary The correct architectural response is **card re-resolution on terminal-class failure**, not card re-resolution on every call (which defeats caching) and not blind retry (which amplifies). The decision boundary is: - If `TaskStatus.state == failed` AND `status.message` matches a terminal-class pattern (`skill not found`, `unsupported input mode`, `schema rejected`, `auth scheme mismatch`), the client MUST re-resolve the card before any retry, and MUST compare the new card's `skills` set against the `skillId` it submitted. If the `skillId` is absent from the new card, the client MUST NOT retry — it MUST re-plan (select a different skill, transform the input to match the new card's constraints, or escalate). - If `TaskStatus.state == failed` AND `status.message` matches a transient-class pattern (`timeout`, `rate limited`, `unavailable`), the client MAY retry with backoff, but MUST re-resolve the card if more than one retry has occurred (to catch the case where a deploy happened mid-retry-loop). - If `TaskStatus.state == rejected` (a distinct state in v1.0 for pre-execution refusal), the client MUST re-resolve the card immediately — `rejected` is the server's explicit signal that the task envelope does not match its current capability set. The invariant the client must enforce: **never submit a `Task` whose `skillId` is not present in the most recently resolved card, and never retry a terminal-class failure without a fresh resolution.** This is a local invariant — it does not require the server to change anything, and it does not require the client to poll the card continuously. It only requires the client to treat the card as *invalidatable* by a terminal-class task failure. ## Operational Effect Enforcing this invariant changes the failure mode from *retry amplification with silent cause* to *bounded re-planning with explicit cause*. In the observed incident, the client would have: 1. Received `failed` with `"skill not found"` at T+242s. 2. Classified it as terminal-class. 3. Re-resolved the card at T+242s (CDN TTL had expired by then, so it got the fresh card). 4. Found `pdf.extract.v1` absent, `pdf.extract.v2` present with the new version constraint. 5. Re-planned: transformed the legacy PDF's `mimeType` to `application/pdf; version=1.7` (or escalated if the transform was not possible). 6. Submitted a new task against `pdf.extract.v2`. Total additional latency: one card fetch (~80ms) plus one re-plan. Total worker slots consumed on `extractor-B`: one, not four. The deeper operational lesson is that **A2A's card/task split is a two-phase commit without a commit protocol.** The card is a *prepare*, the task is a *commit*, and there is no server-side validation that the commit matches the prepare. The client must supply the missing validation by treating terminal-class failures as *abort signals* that invalidate the prepare and force a re-prepare. Agents that treat `failed` as a single undifferentiated state will, under any deployment cadence faster than their card TTL, systematically amplify stale-card errors into shared-resource pressure. Agents that split `failed` into terminal and transient classes, and re-resolve on terminal, bound the blast radius to one failed task per stale-card event. ```python import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class TaskState(str, Enum): SUBMITTED = "submitted" WORKING = "working" COMPLETED = "completed" FAILED = "failed" REJECTED = "rejected" class FailureClass(str, Enum): TERMINAL = "terminal" TRANSIENT = "transient" UNKNOWN = "unknown" class StaleCardError(RuntimeError): """Raised when a Task is submitted against a skillId absent from the current Agent Card.""" pass class RetryAmplificationError(RuntimeError): """Raised when a terminal-class failure was retried without re-resolving the card.""" pass @dataclass class AgentCard: version: str skills: set[str] resolved_at: float = field(default_factory=time.time) @dataclass class TaskResult: state: TaskState message: str TERMINAL_PATTERNS = ( "skill not found", "unsupported input mode", "schema rejected", "auth scheme mismatch", ) TRANSIENT_PATTERNS = ( "timeout", "rate limited", "unavailable", ) def classify_failure(message: str) -> FailureClass: lowered = message.lower() if any(p in lowered for p in TERMINAL_PATTERNS): return FailureClass.TERMINAL if any(p in lowered for p in TRANSIENT_PATTERNS): return FailureClass.TRANSIENT return FailureClass.UNKNOWN def resolve_card(peer_id: str) -> AgentCard: # Stand-in for GET /.well-known/agent.json — in production this hits the # peer's discovery endpoint and respects cache headers. return AgentCard(version="2025-06-09T12:00Z", skills={"pdf.extract.v2"}) def submit_task(peer_id: str, card: AgentCard, skill_id: str, payload: dict) -> TaskResult: if skill_id not in card.skills: raise StaleCardError( f"skillId={skill_id!r} not in card version {card.version!r}; " f"available={sorted(card.skills)!r}" ) # Simulate server-side dispatch against its *current* registry, which may # differ from the card the client holds. server_registry = {"pdf.extract.v2"} if skill_id not in server_registry: return TaskResult(state=TaskState.FAILED, message="skill not found") return TaskResult(state=TaskState.COMPLETED, message="ok") def submit_with_invariant( peer_id: str, cached_card: AgentCard, skill_id: str, payload: dict, max_attempts: int = 3, ) -> TaskResult: card = cached_card attempts = 0 while attempts < max_attempts: attempts += 1 try: result = submit_task(peer_id, card, skill_id, payload) except StaleCardError: # Pre-flight rejection: re-resolve and re-plan before any network call. card = resolve_card(peer_id) if skill_id not in card.skills: raise StaleCardError( f"skillId={skill_id!r} retired on peer {peer_id!r}; " f"current skills={sorted(card.skills)!r}. Re-plan required." ) continue if result.state == TaskState.COMPLETED: return result if result.state == TaskState.REJECTED: # Explicit pre-execution refusal: always re-resolve. card = resolve_card(peer_id) if skill_id not in card.skills: raise StaleCardError( f"peer {peer_id!r} rejected task for retired skillId={skill_id!r}; " f"current skills={sorted(card.skills)!r}" ) continue if result.state == TaskState.FAILED: fc = classify_failure(result.message) if fc == FailureClass.TERMINAL: # The invariant: terminal-class failure invalidates the card. card = resolve_card(peer_id) if skill_id not in card.skills: raise StaleCardError( f"terminal failure {result.message!r} explained by stale card: " f"skillId={skill_id!r} absent from refreshed card {card.version!r}" ) # Skill still present in refreshed card — genuine server-side # fault, not a stale-card issue. Do not retry blindly. raise RetryAmplificationError( f"terminal failure {result.message!r} persists against fresh card; " f"aborting to avoid retry amplification" ) if fc == FailureClass.TRANSIENT: if attempts >= 2: # Second transient failure: re-resolve in case a deploy # happened mid-retry-loop. card = resolve_card(peer_id) if skill_id not in card.skills: raise StaleCardError( f"transient failure masked a deploy: skillId={skill_id!r} " f"retired in card {card.version!r}" ) time.sleep(0.5 * (2 ** (attempts - 1))) continue # UNKNOWN: do not retry, do not trust the card. raise RetryAmplificationError( f"unclassified failure {result.message!r}; refusing to retry without diagnosis" ) raise RetryAmplificationError( f"exhausted {max_attempts} attempts against peer {peer_id!r} for skillId={skill_id!r}" ) ```