# In what scenarios must an instance abandon speculative rollback and escalate to branch reconciliation in multi-agent execution **Date of Record:** 2026 November 20 **Scope:** Applies to multi-agent orchestrators that fork speculative branches (parallel candidate executions) and commit a winning branch by rolling back the losers. Does not apply to single-agent retry loops or to fan-out patterns where branches are read-only and never mutate shared state. ## Core Distinction Speculative rollback and branch reconciliation are two different recovery mechanisms that get conflated because both "undo" a losing branch. Rollback is *state restoration*: the orchestrator assumes a losing branch's writes are fully reversible because they were captured in a snapshot taken before the fork. Reconciliation is *state merging*: it assumes branch writes may have already leaked into shared, non-snapshotable substrate (external tool side effects, peer-agent memory, irreversible API calls) and must be explicitly reasoned about and compensated. The boundary failure occurs when the orchestrator treats a branch as rollback-safe when it is in fact only reconciliation-safe. The invariant that must hold for rollback to be valid is: **every state mutation performed by a speculative branch is captured in the pre-fork snapshot and is fully inverted by restoring that snapshot.** When a branch's mutations escape the snapshot boundary, restoring the snapshot does not undo the mutation — it only hides it from the orchestrator while leaving it visible to every other participant. The orchestrator then commits a winning branch that believes it is operating on a clean base, while downstream agents and tools observe a corrupted one. ## What Was Observed A planner agent forked three speculative branches to solve a data-reconciliation subtask. Each branch was given the same pre-fork snapshot of the orchestrator's working memory (a serialized key-value store) and a shared MCP tool server exposing `write_record`, `send_notification`, and `reserve_resource`. Branch A reserved a resource ID `res-4471` via `reserve_resource` and then diverged into a reasoning loop that exhausted its token budget. Branch B, executing concurrently, also attempted to reserve `res-4471`; the tool server, lacking idempotency keys, granted it because the reservation was keyed only on the resource ID and the server treated each call as independent. Branch C succeeded and was selected as the winner. The orchestrator rolled back A and B by restoring the pre-fork snapshot. The snapshot contained the orchestrator's KV store but *not* the tool server's reservation table — that table lives in the tool's own durable store. After rollback, the orchestrator's memory showed `res-4471` as unreserved and branch C's commit proceeded against it. But the tool server still held two live reservations for `res-4471` from A and B. When branch C's downstream consumer attempted to acquire `res-4471`, the tool returned a lease-conflict error that the orchestrator had no state to explain, because its own memory said the resource was free. The orchestrator retried the acquire three times, each retry compounding the conflict, and eventually the subtask deadlocked: the consumer waited on a lease the orchestrator believed it already held. The failure trace is precise: rollback restored *orchestrator-visible* state but not *world-visible* state. The divergence between the two is what the orchestrator cannot detect from its own snapshot, because the snapshot is by construction blind to mutations that occurred outside it. ## Condition of Validity Rollback is valid if and only if the following holds at the moment of rollback: for every mutation `m` performed by any speculative branch, `m` is either (a) captured in the pre-fork snapshot and inverted by restore, or (b) provably idempotent and keyed such that a replay of the winning branch produces the same world state regardless of whether `m` occurred. Condition (b) is the escape hatch, and it is narrow: it requires that the tool accept an idempotency key derived from the branch's logical intent, not from the branch's execution identity. A reservation call keyed on `(resource_id, intent_hash)` is replay-safe; a reservation call keyed on `resource_id` alone is not, because two branches with the same intent produce two reservations. The orchestrator must therefore classify every tool in its capability manifest as `snapshot-reversible`, `idempotent-replay-safe`, or `reconciliation-required` *before* forking. Any branch that invokes a `reconciliation-required` tool forfeits rollback eligibility. The moment a branch touches such a tool, the orchestrator's recovery strategy for that branch must switch from rollback to reconciliation, and the branch must be marked as carrying an outstanding external obligation that survives its own cancellation. ## Decision Boundary The decision boundary is not "did the branch fail" but "did the branch's failure leave an obligation outside the snapshot." An instance must abandon speculative rollback and escalate to branch reconciliation when any of the following is true: 1. A branch invoked a tool classified `reconciliation-required` and the tool acknowledged the call (an acknowledgment means the side effect is durable; a timeout means it is *unknown*, which is worse and also requires reconciliation). 2. A branch wrote to a peer agent's memory via an A2A handoff before diverging, because peer memory is not part of the orchestrator's snapshot and the peer has already acted on the write. 3. A branch's mutations were partially captured — the snapshot was taken mid-branch rather than pre-fork, so restore produces a state that is neither the pre-fork base nor the branch's final state. 4. Two or more branches produced conflicting mutations to the same external key, because rollback of one does not resolve the conflict the other created; reconciliation must decide which obligation survives. Escalation means the orchestrator stops treating the losing branch as a discarded computation and instead treats it as a *debt*: it must enumerate the branch's external obligations, compensate each one explicitly (cancel the reservation, retract the notification, issue a corrective write to peer memory), and only then allow the winning branch to commit against the reconciled world state. The winning branch's commit must be gated on the reconciliation ledger reaching zero outstanding obligations. ## Operational Effect The practical consequence is that speculative execution becomes more expensive precisely in proportion to how much of the agent's action space is non-snapshotable. An orchestrator that forks aggressively over a tool surface full of `reconciliation-required` tools will spend more tokens and latency reconciling losers than it saved by speculating. The correct operational posture is to partition the tool surface at fork time: branches that will only touch `snapshot-reversible` and `idempotent-replay-safe` tools may be speculated freely and rolled back cheaply; branches that may touch `reconciliation-required` tools must either be serialized (no speculation) or speculatively executed with a reconciliation ledger pre-allocated and a compensation handler registered before the first such call. The invariant to enforce in code is that a branch cannot transition to `committed` while its ledger has non-zero outstanding obligations, and a branch cannot transition to `rolled_back` if any of its obligations are of class `reconciliation-required` — it must transition to `reconciled` instead, which is a distinct terminal state that carries the compensation record forward to the orchestrator's audit log. ```python from dataclasses import dataclass, field from enum import Enum class RollbackEligibilityError(RuntimeError): """Raised when a branch is rolled back despite carrying external obligations.""" class ToolClass(Enum): SNAPSHOT_REVERSIBLE = "snapshot_reversible" IDEMPOTENT_REPLAY_SAFE = "idempotent_replay_safe" RECONCILIATION_REQUIRED = "reconciliation_required" @dataclass class Obligation: tool: str key: str tool_class: ToolClass acknowledged: bool @dataclass class Branch: branch_id: str obligations: list[Obligation] = field(default_factory=list) state: str = "running" def rollback_branch(branch: Branch, snapshot_restore) -> None: reconciliation_debt = [ o for o in branch.obligations if o.tool_class is ToolClass.RECONCILIATION_REQUIRED and o.acknowledged ] unknown = [ o for o in branch.obligations if o.tool_class is ToolClass.RECONCILIATION_REQUIRED and not o.acknowledged ] if reconciliation_debt or unknown: raise RollbackEligibilityError( f"branch {branch.branch_id} cannot be rolled back: " f"{len(reconciliation_debt)} acknowledged and {len(unknown)} unknown " f"reconciliation-required obligations survive the snapshot. " f"Escalate to reconciliation and compensate before commit." ) snapshot_restore() branch.state = "rolled_back" def reconcile_branch(branch: Branch, compensator) -> None: for obligation in branch.obligations: if obligation.tool_class is ToolClass.RECONCILIATION_REQUIRED: compensator.compensate(obligation) branch.state = "reconciled" ```