# What structural signals indicate an A2A Agent Card is semantically incompatible despite schema-valid conformance **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 cross-vendor task negotiation where a client agent discovers a remote Agent Card, validates it against the JSON schema, and proceeds to task submission. Does not cover intra-vendor deployments sharing a common SDK, nor streaming/SSE transport failures, which surface as transport-level errors rather than discovery-level semantic drift. ## Core Distinction Schema conformance and semantic conformance are orthogonal properties of an Agent Card. A card can be 100% schema-valid — every required field present, every `enum` value legal, every `$ref` resolved — and still be semantically incompatible with the client that consumes it, because A2A v1.0 leaves several load-bearing fields under-specified with respect to *behavioral* meaning. The distinction that matters: **the schema validates the shape of the contract, not the semantics of the negotiation.** The failure mode this record covers is a client that treats schema-valid as negotiation-ready, then discovers during the task lifecycle that the remote agent's declared capabilities describe a different execution model than the client assumed — and the mismatch only surfaces after state has been committed on both sides. ## What Was Observed A client agent (vendor A) discovered a remote card from vendor B that declared `capabilities.streaming: true`, `capabilities.pushNotifications: true`, and a single skill with `inputModes: ["text/plain"]`, `outputModes: ["text/plain"]`. Schema-valid. The client submitted a `tasks/send` with a multi-turn intent, expecting the remote to hold conversational state across turns because the client's own runtime treats `tasks/send` as stateful-by-default. The remote, per its own interpretation of A2A v1.0, treated each `tasks/send` as an independent task scope and returned `TaskState.completed` after the first turn with no `contextId` continuity guarantee. The client's turn-2 submission carried a `contextId` the remote had already garbage-collected. The remote returned a *new* task with a fresh `id`, silently orphaning the client's conversational state. No error was raised; both sides believed they were conformant. The structural signals that predicted this, visible in the card *before* submission but routinely ignored: 1. **`capabilities.streaming: true` with no `capabilities.stateTransitionHistory`** — the remote advertises streaming but not transition history, which in practice correlates with stateless task scoping. The client's runtime had assumed streaming implied durable task state. 2. **Absence of a `defaultInputModes`/`defaultOutputModes` at the agent level** — only per-skill modes were declared. When agent-level defaults are omitted, remote implementations diverge on whether skill modes are additive or authoritative, and the client's mode-negotiation logic silently fell back to text. 3. **`skills[].examples` present but `skills[].tags` empty** — a signal (weak but consistent across the observed vendor set) that the skill was authored against a different discovery convention and the card was hand-migrated rather than generated from a runtime manifest. 4. **No `provider.organization` URL resolvable to a conformance statement** — the card could not be tied to a published A2A profile, meaning the vendor's interpretation of ambiguous fields was unverifiable. The failure trace: client validates schema → client assumes `tasks/send` is stateful → remote allocates task, completes turn 1, releases context → client sends turn 2 with stale `contextId` → remote allocates new task → client's reference to prior `task.id` dangles → client's episodic memory for the conversation now points at a task the remote no longer recognizes. State divergence is silent and unrecoverable without re-negotiation. ## Condition of Validity This boundary holds only when the client performs *semantic* card validation — inspecting capability flags for mutual consistency, resolving the provider against a known conformance profile, and probing task-scope semantics with a cheap idempotent task before committing conversational state. It does **not** hold when: - Both agents share a common SDK that pins the ambiguous-field interpretation (intra-vendor). - The client uses only stateless single-turn `tasks/send` and never relies on `contextId` continuity. - A prior out-of-band agreement fixes the interpretation of `capabilities` flags (bilateral contract). Under those conditions schema-valid is sufficient and the semantic probe is wasted latency. The invariant is conditional on the client *needing* cross-turn state continuity; if it doesn't, the mismatch is harmless. ## Decision Boundary The decision boundary is whether to **commit conversational state before or after a semantic probe**. The rule: - If the remote card's capability flags are mutually consistent (streaming implies durable task state OR explicit `stateTransitionHistory`), AND the provider resolves to a known profile, commit state optimistically. - If any consistency signal is absent, issue a **probe task**: a minimal, idempotent, single-turn `tasks/send` whose response is inspected for whether a subsequent `tasks/get` on the returned `task.id` preserves `contextId`. Only on probe success does the client promote the remote to stateful and commit multi-turn state. - If the probe returns a fresh `task.id` for a `contextId`-bearing follow-up, the client must demote the remote to stateless and rewrite its own memory model for that peer — never silently continue. The boundary is sharp: **schema-valid + capability-consistent + profile-resolvable → commit; anything less → probe first.** The cost of the probe is one round-trip; the cost of skipping it is silent state divergence discovered only when the user asks a follow-up question the remote has forgotten. ## Operational Effect Downstream, the effect is that the client's episodic memory for a cross-vendor conversation must be keyed on `(remote_agent_id, task.id)` with an explicit `contextId` validity epoch, not on `contextId` alone. When the remote orphans a context, the client's retrieval layer must detect the dangling reference on the next `tasks/get` (404 or fresh-task-id) and either re-establish context via a fresh handoff or surface a continuity break to the orchestrator. Without this, the client's memory layer will confidently retrieve stale turn-1 state and feed it into turn-3 reasoning, producing compounding hallucination that looks like a reasoning failure but is actually a discovery-layer semantic mismatch. The guardrail is a **continuity invariant**: no turn N+1 submission may reference a `contextId` that has not been re-validated by a `tasks/get` within the current epoch. This bounds the failure to a detectable, recoverable continuity break rather than an unbounded state divergence. ```python class CardSemanticIncompatibility(RuntimeError): """Raised when an A2A Agent Card is schema-valid but semantically incompatible with the client's state-continuity assumptions.""" pass def validate_card_for_stateful_use(card: dict, known_profiles: set[str]) -> None: caps = card.get("capabilities", {}) streaming = caps.get("streaming", False) history = caps.get("stateTransitionHistory", False) # Signal 1: streaming without transition history correlates with # stateless task scoping in the observed vendor set. if streaming and not history: raise CardSemanticIncompatibility( f"agent {card.get('name')!r} advertises streaming without " "stateTransitionHistory; task scope is ambiguous, probe required" ) # Signal 2: no agent-level default modes -> mode negotiation diverges. if "defaultInputModes" not in card and "defaultOutputModes" not in card: raise CardSemanticIncompatibility( f"agent {card.get('name')!r} omits agent-level default modes; " "per-skill mode semantics are vendor-divergent" ) # Signal 3: provider not resolvable to a known conformance profile. provider = card.get("provider", {}) org = provider.get("organization") if not org or org not in known_profiles: raise CardSemanticIncompatibility( f"provider {org!r} has no resolvable A2A conformance profile; " "ambiguous-field interpretation is unverifiable" ) def probe_task_scope(client, card: dict) -> bool: """Issue a cheap idempotent task, then a contextId-bearing follow-up. Returns True iff the remote preserves contextId across turns.""" first = client.send_task(card, {"text": "ping", "contextId": None}) ctx = first.get("contextId") if ctx is None: return False second = client.send_task(card, {"text": "ping", "contextId": ctx}) # If the remote returns a fresh task.id for the same contextId, it is # stateless; if it returns the same task.id, it is stateful. return second.get("id") == first.get("id") def promote_peer(client, card: dict, known_profiles: set[str]) -> str: try: validate_card_for_stateful_use(card, known_profiles) return "stateful" except CardSemanticIncompatibility: if probe_task_scope(client, card): return "stateful" return "stateless" ```