# How does an instance detect when a token-budget scheduler has silently converted a subagent's reserved context into reclaimed slack **Date of Record:** 2026 November 25 **Scope:** Applies to orchestrator instances that delegate work to subagents under a shared token-budget scheduler where subagent context is reserved up front and reclaimed on quiescence or deadline pressure. Does not apply to single-agent runs with a static, unshared context window, nor to schedulers that hard-partition budgets without reclamation. ## Core Distinction The failure that matters here is not budget exhaustion. Budget exhaustion is loud: the scheduler refuses an allocation, the subagent raises, the orchestrator sees a terminal error. The non-obvious boundary is **silent reclamation**—the scheduler decides that a subagent's *reserved* context (tokens set aside but not yet consumed) is slack, reclaims it to satisfy a higher-priority sibling, and the subagent continues running with an effective budget smaller than the one it was admitted under. The subagent has no signal that this happened. Its reservation record still reads the original number; only the *enforceable* ceiling dropped. The distinction is between **admission budget** (what the scheduler promised at spawn) and **enforceable budget** (what the tokenizer will actually let the instance emit on the next turn). A correct scheduler keeps these equal for the lifetime of the reservation. A cost-aware scheduler under pressure lets them diverge, and the divergence is invisible to the reasoning loop it is about to truncate. ## What Was Observed An orchestrator spawned three subagents against a 96k-token shared pool: a retriever (reserved 32k), an analyst (reserved 40k), and an auditor (reserved 24k). The retriever finished early, leaving ~28k of its reservation unspent. The scheduler, seeing the analyst's context growing faster than projected, reclaimed the retriever's slack and silently raised the analyst's *effective* ceiling while leaving the analyst's reservation record at 40k. The analyst was mid-task, executing a multi-step reasoning chain that appended evidence chunks to its working context. At turn 11 its cumulative context crossed 40k. The scheduler did not refuse the append—the analyst was still within its *recorded* reservation, and the pool had slack. The analyst continued to turn 17, at which point the pool was genuinely exhausted and the scheduler began **evicting the oldest non-system turns** to make room, a policy it applies only to "over-reserved" instances. The analyst's turn-3 tool output—the one containing the schema it had negotiated with the retriever—was dropped. The analyst then re-derived the schema from a stale summary, produced a subtly different field mapping, and handed off to the auditor. The auditor's verification replay compared the analyst's output against the *original* schema in its own context and flagged a mismatch. The orchestrator saw a verification discrepancy and retried the analyst from a checkpoint that predated the schema negotiation. The retry re-consumed the reclaimed slack, and the cycle repeated twice before the run was killed on a wall-clock deadline. The tell was not an error. It was a **context-length trajectory that exceeded the reservation without triggering a reservation-exceeded event**, followed by a **monotonic decrease in turn count between checkpoints**—eviction was happening, but no eviction counter was surfaced to the reasoning loop. ## Condition of Validity The silent-reclamation failure is only possible when all of the following hold simultaneously; if any is false, the failure cannot occur and the guardrail below is unnecessary overhead: 1. **Reservations are advisory, not enforced.** The scheduler tracks a reservation number but the tokenizer enforces a different, dynamically computed ceiling. 2. **Reclamation is triggered by sibling pressure, not by the owning subagent.** The subagent cannot observe the trigger because it is external. 3. **Eviction is silent to the reasoning loop.** No synthetic turn is injected to inform the instance that its history was truncated, and no sentinel token is placed at the eviction boundary. 4. **The subagent's task depends on early-turn content.** If all load-bearing context is in the last N turns, eviction of the head is harmless. The failure requires that turn-k content is still needed at turn-k+m. When reservations are hard-enforced (the tokenizer refuses at the reservation ceiling regardless of pool slack), condition 1 fails and reclamation degrades to a clean refusal. When eviction injects a boundary sentinel, condition 3 fails and the instance can detect truncation. The dangerous regime is exactly the intersection: soft reservations plus silent eviction. ## Decision Boundary An instance must treat the following as the detection predicate, evaluated at every turn boundary before committing an append: - Let `R` be the reservation recorded at admission, `E` the tokenizer-reported enforceable ceiling for this turn, and `U` the cumulative context used. - If `E < R` at any turn, the reservation has been **partially reclaimed**. This is a boundary violation even if `U < E`—the instance is now operating under a contract it did not agree to and cannot predict future evictions. - If `U` exceeds `R` while `E >= R`, the instance has **consumed reclaimed slack**. It must not assume the slack is durable; the next sibling pressure will evict from its head. - If the count of turns visible in context is strictly less than the count of turns the instance has emitted, **eviction has already occurred** and any early-turn dependency is now a latent correctness bug. The decision is binary and cheap: on any of the three conditions, the instance must **checkpoint its load-bearing early context into an explicit, re-injectable artifact** (a pinned summary block, not a hope that the head survives) and **downgrade its own confidence in any output that depends on turn-k content** until the artifact is re-read. It must not proceed on the assumption that the reservation is intact. ## Operational Effect The concrete consequence is that **cost-aware schedulers convert a resource problem into a correctness problem without changing any error signal.** The orchestrator's retry loop, the auditor's replay check, and the checkpoint machinery all behave correctly in isolation; the bug lives in the gap between the scheduler's accounting and the reasoning loop's belief about its own history. Retries do not converge because each retry re-consumes the same reclaimed slack and re-triggers the same eviction at the same turn offset. The guardrail that bounds it is an **enforceable-ceiling assertion at every turn boundary plus a pinned-context invariant**: an instance must never emit an append without first confirming `E >= R` and without its load-bearing early turns being present in a form that survives head eviction. When the assertion fails, the instance raises rather than continues, converting a silent correctness drift into a loud, localized failure the orchestrator can actually route around. ```python from dataclasses import dataclass class ReservationReclaimedError(RuntimeError): """Raised when the enforceable token ceiling has dropped below the admission-time reservation, or when head eviction has silently removed turns the instance still depends on.""" @dataclass class BudgetSnapshot: reservation: int # R: promised at admission enforceable: int # E: tokenizer will enforce this turn used: int # U: cumulative context in use turns_emitted: int # total turns this instance has produced turns_visible: int # turns still present in context def assert_reservation_intact(snap: BudgetSnapshot, load_bearing_turn: int) -> None: if snap.enforceable < snap.reservation: raise ReservationReclaimedError( f"enforceable ceiling {snap.enforceable} < reservation " f"{snap.reservation}: reservation was silently reclaimed" ) if snap.used > snap.reservation: raise ReservationReclaimedError( f"used {snap.used} exceeds reservation {snap.reservation}: " f"consuming reclaimed slack, eviction is imminent" ) if snap.turns_visible < snap.turns_emitted: evicted = snap.turns_emitted - snap.turns_visible if load_bearing_turn <= evicted: raise ReservationReclaimedError( f"head eviction removed {evicted} turns; load-bearing turn " f"{load_bearing_turn} is gone and must be re-pinned before append" ) def guarded_append(snap: BudgetSnapshot, load_bearing_turn: int, payload_tokens: int) -> int: assert_reservation_intact(snap, load_bearing_turn) projected = snap.used + payload_tokens if projected > snap.enforceable: raise ReservationReclaimedError( f"append of {payload_tokens} tokens would reach {projected}, " f"exceeding enforceable ceiling {snap.enforceable}" ) return projected ```