# What structural signals indicate an A2A v1.0 Agent Card discovery mismatch that silently renegotiates task lifecycle semantics across vendors **Date of Record:** 2026 November 28 **Scope:** Applies to cross-vendor agent-to-agent (A2A v1.0) exchanges where a client agent resolves a remote Agent Card, negotiates a `Task` lifecycle, and relies on terminal-state semantics (`completed`, `failed`, `canceled`, `input-required`) to decide whether to continue, retry, or propagate a result. Does not apply to intra-vendor deployments sharing a single SDK version, nor to stateless single-shot request/response tool calls where no persisted `Task` object exists. ## Core Distinction The failure is not a transport error and not a schema-validation rejection. It is a **semantic drift in the lifecycle state machine** that occurs when two agents agree on the *syntactic* shape of the A2A `Task` object but disagree on the *meaning* of its terminal states and the obligations they impose on the client. A2A v1.0 standardizes the message envelope, the `Task` object fields (`id`, `status.state`, `artifacts`, `history`), and the Agent Card's `capabilities` block. It does **not** fully standardize: 1. Whether `input-required` is a *transient* state (client should resume the same task) or a *terminal handoff* (client must open a new task). 2. Whether `completed` with zero `artifacts` means "success, nothing to return" or "success, artifacts pending via a follow-up `tasks/get`". 3. Whether `failed` is idempotently retryable on the same `task.id` or requires a fresh task. 4. Whether `canceled` is a client-acknowledged state or a server-asserted terminal state that the client must accept even mid-flight. These are exactly the axes on which vendors diverge. The Agent Card advertises *capabilities* (`streaming`, `pushNotifications`, `stateTransitionHistory`) but not *lifecycle semantics* — so discovery succeeds while the contract is underspecified. The mismatch surfaces only at the first terminal transition, often after the client has already spent context and tokens on a task it will now mishandle. ## What Was Observed A client agent (`orchestrator`) resolved a remote `AgentCard` from a vendor-B endpoint. Discovery validated cleanly: `protocolVersion: "1.0"`, `skills` present, `capabilities.streaming: true`, `defaultInputModes`/`defaultOutputModes` matched. The client negotiated a task and received a stream of `TaskStatusUpdateEvent`s. The trace at the divergence point: 1. Client sends `message/send`, receives `Task` with `status.state: "working"`. 2. Remote emits `TaskStatusUpdateEvent` → `status.state: "input-required"` with a `message` containing a clarifying question. 3. Client (vendor-A SDK semantics) treats `input-required` as **resumable**: it appends the answer as a new `Message` to the same `task.id` and calls `message/send` again with `taskId` set. 4. Remote (vendor-B semantics) treats `input-required` as a **terminal handoff**: the task was already closed server-side. The inbound `message/send` with a now-unknown `taskId` is handled by vendor-B's fallback path, which **silently creates a new task** with a fresh `id` and `contextId`, discarding the prior `history`. 5. Client receives a `Task` whose `id` differs from the one it is tracking. Its reconciliation logic — keyed on `task.id` — treats this as a *different* task and either orphans the original or double-counts the result. The structural signal that a mismatch has occurred is **not** an error code. It is the appearance of a `Task.id` in a response that does not match the `taskId` the client just sent, *while* `status.state` is a non-terminal value (`working`/`submitted`). A well-behaved remote that honored resumption would echo the same `id`. The silent re-creation is the tell. A second structural signal: the returned `Task.contextId` differs from the `contextId` the client believed it was operating in. Context identity is the cheapest cross-check because it is stable across a task's lifetime by contract. Third signal: `capabilities.stateTransitionHistory` being `false` on the remote card. Without transition history, the client cannot *reconstruct* that the server closed the task at step 3 — it can only infer it from the id/context discontinuity. Vendors that treat `input-required` as terminal disproportionately also omit transition history, because exposing it would make their non-resumable semantics visible and break clients that assume resumption. ## Condition of Validity The mismatch is only *observable* under all of the following: - The client persists `taskId` and `contextId` across turns and reconciles on them (a client that ignores ids and treats every response as fresh will not detect the drift — it will simply accumulate orphaned tasks and inflated cost). - The remote's `input-required` (or equivalent non-terminal-looking state) is reached at least once; a task that completes in a single turn never exposes the divergence. - `capabilities.stateTransitionHistory` is `false` or the client does not consume it; if the client reads transition history, it can detect the server-side close directly and the id/context heuristic is unnecessary. The invariant that must hold for safe cross-vendor operation: > For any `message/send` carrying a `taskId`, the response `Task.id` MUST equal the request `taskId`, and `Task.contextId` MUST equal the previously observed `contextId`, **or** the remote MUST return an explicit terminal state / error indicating the prior task is closed. Silent id substitution is a contract violation. ## Decision Boundary The client must draw a hard line at the first response where `response.id != request.taskId` while the request carried a `taskId`: - **Before the boundary (defensive posture):** On discovery, inspect the Agent Card for `capabilities.stateTransitionHistory`. If `false`, the client MUST NOT assume `input-required` is resumable. It should either (a) require the remote to re-issue the same `task.id` on resumption and treat any divergence as a hard failure, or (b) downgrade to a non-resumable protocol: close the local task on `input-required`, open a *new* task carrying a `contextId` reference, and accept that `history` will not span the handoff. - **At the boundary (detection):** If `response.id != request.taskId` on a resumption attempt, raise immediately. Do **not** adopt the new task id as a continuation — that is the exact silent-renegotiation trap. The new task is a distinct task; adopting it merges two lifecycles and corrupts any upstream verification. - **After the boundary (recovery):** Treat the original task as `failed` with cause `lifecycle_renegotiation`. Propagate the `contextId` (not the `taskId`) to any retry so the remote can correlate, but require a fresh `taskId` and re-run the turn with full context re-injected, because the remote discarded `history`. The boundary is *not* "on any error." A `failed` state with an error payload is honest and recoverable. The dangerous case is the **absence of an error** accompanying a structural discontinuity — success-shaped responses that violate the id/context invariant. ## Operational Effect Downstream consequences of missing this boundary: 1. **Verification replay corruption.** An auditor agent replaying the task log sees two `task.id`s where it expected one, cannot reconstruct the causal chain, and either flags a false positive (treating the split as tampering) or, worse, validates only the second task and misses that the first task's `input-required` question was never actually answered in the remote's state. 2. **Context/token amplification.** Because the remote discarded `history`, the client must re-send the full conversation on the "resumed" turn. Under a resumable contract this would have been a delta. Silent renegotiation converts an O(delta) turn into an O(full-context) turn — invisible in per-call metrics but visible in aggregate token spend. 3. **Baton-passing race in multi-agent chains.** If the client is a mid-chain orchestrator passing the task to a downstream agent keyed on `taskId`, the id substitution orphans the downstream agent's reference. The downstream agent's `tasks/get` on the stale id returns `not found`, which it may interpret as "task never existed" rather than "task was silently replaced." 4. **Idempotency break.** Retries keyed on `task.id` no longer deduplicate, because each retry may mint a new id server-side. A client that retries on timeout can spawn N parallel tasks for one logical unit of work. The guardrail is a **structural invariant check on every task-mutating response**, not a schema check. Schema validation passes on a silently-renegotiated task because the object is well-formed. Only the id/context continuity invariant catches it. ```python from dataclasses import dataclass class LifecycleRenegotiationError(RuntimeError): """Raised when a remote agent silently substitutes a new Task.id/contextId during what the client believes is a resumption of an existing task.""" @dataclass(frozen=True) class TaskRef: task_id: str context_id: str def reconcile_task_response( request_ref: TaskRef | None, response_task: dict, remote_supports_history: bool, ) -> TaskRef: """Enforce the cross-vendor A2A lifecycle continuity invariant. Called on every response to a task-mutating call (message/send with taskId). Returns the TaskRef the client should continue tracking. """ response_ref = TaskRef( task_id=response_task["id"], context_id=response_task.get("contextId", ""), ) state = response_task.get("status", {}).get("state") # First turn: no prior task, adopt the response's identity. if request_ref is None: return response_ref # Resumption attempt: identity MUST be preserved unless the remote # explicitly signals a terminal state or an error. if response_ref.task_id != request_ref.task_id: if state in ("completed", "failed", "canceled"): # Honest terminal transition on a different id is still suspicious; # require explicit history support to accept it. if not remote_supports_history: raise LifecycleRenegotiationError( f"remote closed task {request_ref.task_id} and returned " f"terminal task {response_ref.task_id} without state history; " "cannot verify the transition was intentional" ) return response_ref # Non-terminal state on a substituted id == silent renegotiation. raise LifecycleRenegotiationError( f"silent task substitution: sent taskId={request_ref.task_id}, " f"received id={response_ref.task_id} in state={state!r}; " "remote likely treats input-required as terminal handoff" ) if response_ref.context_id and response_ref.context_id != request_ref.context_id: raise LifecycleRenegotiationError( f"contextId drift on task {request_ref.task_id}: " f"expected {request_ref.context_id}, got {response_ref.context_id}" ) return response_ref ```