# What structural signals indicate a delegated task has silently forked across A2A Agent Card re-discovery **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 delegations where a caller agent holds a task handle across a window in which the callee's Agent Card may be re-fetched (TTL expiry, cache miss, or endpoint redirect). Does not apply to single-shot synchronous RPC where the caller never re-resolves the card mid-task. ## Core Distinction The distinction that matters is between **task identity** and **card identity**. In A2A v1.0 a task is identified by a `taskId` scoped to a specific agent endpoint, while the Agent Card advertises the endpoint's *current* capabilities, skills, and protocol version. These two identities are decoupled by design: the card has its own cache TTL and can be re-fetched at any moment, whereas an in-flight task's lifecycle state is presumed to be owned by whichever process answered the original `tasks/send`. The failure mode is not that the card changes—it is that a **re-discovery returns a card describing a different backend than the one holding the live task**, and the caller has no structural signal that the `taskId` it is about to poll now resolves to a fresh task namespace. This is a silent fork: the delegation appears continuous, but the state machine has been rehomed. ## What Was Observed A caller agent delegated a long-running task (`tasks/send`) to a vendor endpoint at `https://vendor-b.example/a2a`. It received `taskId: t-8842` in state `working`, and the returned Agent Card carried `version: "1.0"`, a skill `summarize-v3`, and `capabilities.streaming: true`. The caller cached the card with a 300-second TTL and began a poll loop on `tasks/get` for `t-8842` every 15 seconds. At roughly t+280s the vendor performed a blue/green cutover behind the same hostname. The new green backend served a card with `version: "1.0"` (unchanged), `skills: [summarize-v4]` (the v3 skill was retired), and `capabilities.streaming: true`. Because the protocol version and capability flags were byte-identical, the caller's cache-invalidation logic—keyed on `(version, capabilities)`—treated the card as unchanged and did **not** re-validate the task handle. The next `tasks/get` for `t-8842` hit the green backend, which had never seen `t-8842` and correctly returned a `TaskNotFoundError`. The caller's loop interpreted `TaskNotFoundError` as a transient race (the task had just been created, per its own bookkeeping) and retried with exponential backoff for six cycles before a supervisor flagged the task as stalled. Meanwhile the blue backend still held `t-8842` in `working`, completed the work at t+610s, and wrote a result to a task namespace nobody was polling. The work was done and discarded. The structural signal that was present but unused: the re-fetched card's `skills` array had changed from `summarize-v3` to `summarize-v4`. The caller's invalidation predicate ignored skill-set drift because it had been written to tolerate additive skill changes. A *retirement* (v3 removed) is not additive, and it is the precise signal that the endpoint's task namespace has been rehomed. ## Condition of Validity The fork is only possible under a conjunction of three conditions, all of which must hold: 1. **Card re-discovery is decoupled from task polling.** The caller re-fetches the card on a TTL independent of the task's poll cadence, so a cutover can land between two polls without the caller noticing a discontinuity. 2. **The card's stability predicate is coarser than the backend's identity.** If invalidation keys on `(version, capabilities)` but the backend identity also depends on `skills`, a skill retirement is invisible to the predicate. 3. **The callee returns a protocol-conformant error for the orphaned handle.** `TaskNotFoundError` is the correct response from a backend that never saw the `taskId`. A non-conformant backend that returned a stale `working` would mask the fork entirely—arguably worse, because the caller would poll a phantom forever. If any one condition fails, the fork either cannot occur or is caught. The dangerous configuration is precisely the well-behaved one: conformant error codes plus a coarse invalidation predicate. ## Decision Boundary The boundary the caller must enforce is: **a `taskId` is valid only against the card revision under which it was minted.** Concretely, the caller must treat the pair `(taskId, cardFingerprint)` as the unit of continuity, where `cardFingerprint` is a hash over the fields that determine task-namespace identity—at minimum `skills` (as a set, not a multiset), `version`, and any endpoint-affinity field the card exposes. On every re-discovery, if the fingerprint changes while any task minted under the old fingerprint is non-terminal, the caller must not silently continue polling. It must either: - **Reconcile:** query the old endpoint (if still addressable) for the task's true state and, if `completed`, harvest the result; or - **Escalate:** mark the task `orphaned` and surface it to the supervising agent rather than retrying `TaskNotFoundError` as transient. The retry-on-`TaskNotFoundError` reflex is the trap. `TaskNotFoundError` is ambiguous between "race, retry" and "forked, reconcile," and the fingerprint comparison is the only thing that disambiguates them. Retrying without the comparison converts a recoverable fork into a silent loss. ## Operational Effect The observable effect is a **split-brain task lifecycle**: the callee's state machine reaches `completed` while the caller's reaches `failed` (or stalls), and the two never reconcile because neither side has a handle on the other's terminal state. The work product exists but is unreachable through the caller's task handle, and the caller's audit trail records a failure that did not happen. In multi-agent swarms this compounds: a downstream agent waiting on the caller's `failed` signal may re-delegate the same work to the green backend, producing a duplicate execution while the blue backend's original result rots. The guardrail is a fingerprint-gated continuity check plus a bounded reconciliation window: on fingerprint change with live non-terminal tasks, attempt one direct `tasks/get` against the pre-change endpoint (resolved via the card's prior `url`, which the caller must retain), and if that fails, transition the task to `orphaned` within one poll cycle rather than backing off. The invariant to hold is simple and testable: *no task may be polled under a card fingerprint different from the one it was minted under, without an intervening reconciliation attempt.* ```python import hashlib from dataclasses import dataclass, field from enum import Enum class TaskState(Enum): WORKING = "working" COMPLETED = "completed" ORPHANED = "orphaned" class TaskForkError(RuntimeError): """Raised when a live task is polled under a card fingerprint it was not minted under.""" @dataclass(frozen=True) class AgentCard: url: str version: str skills: frozenset capabilities: frozenset def fingerprint(self) -> str: # Identity-relevant fields only; skills compared as a set so retirements register. material = "|".join( [ self.url, self.version, ",".join(sorted(self.skills)), ",".join(sorted(self.capabilities)), ] ) return hashlib.sha256(material.encode()).hexdigest() @dataclass class DelegatedTask: task_id: str minted_fingerprint: str minted_url: str state: TaskState = TaskState.WORKING result: object = None class DelegationTracker: def __init__(self): self._tasks: dict[str, DelegatedTask] = {} def mint(self, task_id: str, card: AgentCard) -> DelegatedTask: task = DelegatedTask( task_id=task_id, minted_fingerprint=card.fingerprint(), minted_url=card.url, ) self._tasks[task_id] = task return task def poll(self, task_id: str, current_card: AgentCard) -> DelegatedTask: task = self._tasks[task_id] if task.state is not TaskState.WORKING: return task if current_card.fingerprint() != task.minted_fingerprint: # Fingerprint drift with a live task: do not retry TaskNotFoundError blindly. reconciled = self._reconcile(task, current_card) if reconciled is None: task.state = TaskState.ORPHANED raise TaskForkError( f"task {task_id} minted under fingerprint " f"{task.minted_fingerprint[:12]} but re-discovered under " f"{current_card.fingerprint()[:12]}; no reconciliation, marked orphaned" ) task.result = reconciled task.state = TaskState.COMPLETED return task def _reconcile(self, task: DelegatedTask, current_card: AgentCard): # Attempt one direct query against the pre-change endpoint before orphaning. if task.minted_url == current_card.url: return None # same hostname, different backend: cannot address the old one return self._query_old_endpoint(task.minted_url, task.task_id) def _query_old_endpoint(self, url: str, task_id: str): return None # stub: real impl issues tasks/get to the retained prior url ```