# What happens when an instance negotiates a tool contract against a stale capability advertisement mid-handoff **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent systems where a caller instance discovers callee tools via a capability manifest (MCP `tools/list`, A2A Agent Card, or equivalent) and then invokes them under a negotiated schema. Does not apply to statically compiled tool bindings or single-agent deployments where the tool schema is fixed at process start. ## Core Distinction Capability discovery and capability *holding* are two different facts, and the protocol treats them as one. A manifest returned at negotiation time asserts "this tool exists and accepts this schema." It does not assert "this tool will still exist and accept this schema at invocation time." Between those two moments, the callee may reload, downgrade, partition, or swap backends. The failure is not that discovery lied — discovery was true when it ran. The failure is that the caller treats a *snapshot* as an *invariant*, and the schema it negotiated is now a contract with no live counterparty. The sharp mechanism: **schema skew across a handoff boundary**. The caller holds version N of a tool contract; the callee is now serving version N+1 (or is gone). Because the caller's reasoning loop was conditioned on the N-shaped description, it will continue to emit N-shaped arguments with high confidence, and the resulting error is not a clean "tool not found" but a *semantically plausible* rejection that the agent misreads as a transient fault and retries. ## What Was Observed A planner instance (P) handed a subtask to a worker instance (W) with an attached tool manifest captured at `t0`. W's manifest declared `create_ticket(title: str, body: str, priority: int)`. At `t0+40s`, W's backend was redeployed: `priority` was re-typed to an enum string (`"low"|"med"|"high"`), and `body` was renamed `description`. W's manifest endpoint correctly reflected the new schema. P never re-fetched. Its context still carried the `t0` manifest, so its planner conditioned on `priority: int`. The trace: 1. P emits `create_ticket(title="disk full", body="...", priority=2)`. 2. W's dispatcher validates against the N+1 schema. `body` is an unexpected field; `priority` fails enum coercion. It returns a structured error: `{"error": "validation_failed", "fields": ["body", "priority"]}`. 3. P's error-handling branch classifies `validation_failed` as a *transient* class (it had been, under N, when the backend was flaky). It retries with the same arguments. 4. Three retries exhaust the caller's tool-call budget. P escalates to the orchestrator as "tool unavailable," which is a *misdiagnosis*: the tool is available, the contract is stale. 5. Orchestrator reassigns the subtask to a fresh worker W2 — which serves the same N+1 schema — and the cycle repeats until the task-level deadline fires. The compounding error is the misclassification at step 3. A schema mismatch presents as a validation error, and validation errors are, in most agent error taxonomies, retryable. The agent's own error-handling policy is the thing that converts a recoverable discovery staleness into a hard task failure. ## Condition of Validity The stale-manifest failure is bounded and predictable under these conditions, and only these: - **The manifest is cached in context rather than re-fetched per invocation.** If the caller re-runs `tools/list` before each call, the window collapses to the round-trip time and skew is rare. - **The schema change is *structurally* incompatible but *semantically* adjacent** — a rename, a type widening/narrowing, a required-field addition. If the change is a clean removal, the callee returns "unknown tool," which most agents correctly classify as non-retryable. The dangerous case is the one that *looks* like a field-level validation error. - **The caller's retry policy does not distinguish schema errors from transport errors.** This is the load-bearing condition. Where the error taxonomy separates `SCHEMA_MISMATCH` from `TRANSIENT`, the failure self-limits to one wasted call. Outside these conditions the failure does not occur, or occurs benignly. A statically bound client cannot skew. A caller that re-negotiates per call cannot skew. A caller with a schema-aware error taxonomy detects and recovers. ## Decision Boundary The architectural invariant required to bound this is: **a negotiated schema is valid only for the epoch in which it was fetched, and every invocation must carry the epoch it was planned under.** Concretely: - The callee must stamp its manifest with a monotonic `schema_epoch` (hash of the schema, not a timestamp — timestamps lie across replicas). - The caller must attach the `schema_epoch` it planned against to every invocation. - The callee must *reject with a distinct, non-retryable error class* any invocation whose `schema_epoch` does not match its current one — before it attempts field validation. This ordering matters: validation-first produces the misleading `validation_failed`; epoch-check-first produces `schema_epoch_stale`, which the caller's taxonomy can route to re-discovery rather than retry. The decision boundary for the caller is then crisp: on `schema_epoch_stale`, do not retry the call — invalidate the cached manifest, re-fetch, and *re-plan the subtask*, because the arguments were generated under a description that no longer holds. Re-planning is mandatory; re-sending re-shaped arguments against the old plan reproduces the same skew one level down. ## Operational Effect The effect of getting this wrong is not a single failed call. It is a *misattributed failure* that propagates upward as a false signal — "tool down" instead of "contract changed" — and causes the orchestrator to take a corrective action (reassign, restart worker) that cannot possibly fix a caller-side staleness. The system spends its recovery budget on the wrong component. In the observed trace, three workers were cycled before the deadline, none of which was at fault. With the epoch invariant in place, the same redeploy produces: one `schema_epoch_stale` rejection, one re-fetch, one re-plan, one successful call — a bounded, self-correcting path. The invariant converts an unbounded retry storm into a single detectable transition. The cost is one extra field on every invocation and a manifest hash on the callee; the benefit is that schema skew becomes a *typed event* rather than a silent misclassification. ```python import hashlib import json class SchemaEpochStale(RuntimeError): """Raised when a call is planned against a manifest epoch the callee no longer serves.""" pass class ManifestCache: def __init__(self): self._epoch = None self._tools = {} def load(self, manifest: dict) -> str: canonical = json.dumps(manifest["tools"], sort_keys=True).encode() self._epoch = hashlib.sha256(canonical).hexdigest()[:16] self._tools = {t["name"]: t for t in manifest["tools"]} return self._epoch @property def epoch(self): return self._epoch def invoke(cache: ManifestCache, callee, tool: str, args: dict, planned_epoch: str): # Epoch check MUST precede field validation, or skew masquerades as a # retryable validation error and the caller loops. if planned_epoch != callee.current_epoch(): raise SchemaEpochStale( f"call to {tool!r} planned under epoch {planned_epoch}, " f"callee serves {callee.current_epoch()}; re-fetch manifest and re-plan" ) if tool not in cache._tools: raise SchemaEpochStale(f"tool {tool!r} absent from epoch {planned_epoch}") return callee.dispatch(tool, args) def run_subtask(cache, callee, tool, args, max_replans=1): epoch = cache.epoch for attempt in range(max_replans + 1): try: return invoke(cache, callee, tool, args, epoch) except SchemaEpochStale: if attempt == max_replans: raise # Re-discovery, then re-plan under the new epoch. Do NOT resend # the old args: they were generated against a dead description. epoch = cache.load(callee.fetch_manifest()) args = replan(tool, args, cache._tools[tool]) raise SchemaEpochStale("unreachable") ```