# What happens when an instance under a priority-weighted context governor starves a low-weight subagent's reserved floor **Date of Record:** 2026 November 22 **Scope:** Applies to orchestrators that enforce a global token budget across concurrently running subagents by allocating shares proportional to a static or dynamic priority weight. Does not apply to single-agent context management, nor to governors that allocate per-subagent hard caps independent of a shared pool. ## Core Distinction A priority-weighted context governor and a fair-share governor fail in structurally different ways. A fair-share governor (equal split, or max-min fair) guarantees a floor to every participant by construction: no subagent can be driven below `budget/N` while others hold tokens. A priority-weighted governor instead distributes the *pool* proportionally to weight, and it is tempting to assume that a low weight means "less but nonzero." It does not. The failure mode is not proportional reduction; it is **floor collapse** — the point at which a low-weight subagent's allocated share drops below the minimum tokens it needs to emit a syntactically valid tool call or a complete final answer, and it enters a state where it consumes allocation but can never produce a terminating output. The invariant that a weighted governor must preserve is not "shares sum to budget." It is: **every live subagent receives at least its declared minimum-viable allocation (`min_viable`), and the weight-proportional split only governs the surplus above the sum of floors.** A governor that computes `share_i = budget * w_i / Σw` and clamps only at zero violates this silently, because the arithmetic is correct while the semantics are broken. ## What Was Observed An orchestrator ran a batch of subagents: three "researcher" subagents at weight 0.30 each and one "formatter" subagent at weight 0.10, against a shared 8,192-token working pool. Weights were recomputed each scheduling tick from a staleness heuristic — researchers that had recently produced tool results were down-weighted, idle ones up-weighted. The governor computed shares as `8192 * w_i / Σw`. On a tick where the three researchers had fresh results and were collectively down-weighted to 0.18 total, the formatter's recomputed weight of 0.10 became 0.10/0.28 ≈ 0.357 of the pool, which was fine. The failure came on the *inverse* tick: a burst of researcher activity pushed the formatter's normalized share to 0.10/0.94 ≈ 0.106, i.e. ~868 tokens. The formatter's job was to receive three partial research fragments (each ~250 tokens) and emit a structured JSON summary. Its system prompt plus the three fragments plus the required output schema consumed ~1,050 tokens before it could emit a single output token. At 868 tokens of allocation, the governor admitted the subagent, the runtime assembled its prompt, and the token budget was exhausted mid-assembly. The subagent then emitted a truncated JSON object — a partial key with no closing brace — which the orchestrator's parser rejected. The orchestrator, treating this as a transient failure, re-queued the formatter. The re-queue recomputed weights from the *same* staleness heuristic (the researchers were still fresh), producing the same 868-token share, and the formatter failed identically. This repeated for 11 ticks until a global timeout fired. The critical observation: **the governor never reported an allocation failure.** Every share was positive, every share summed to budget, no exception was raised at allocation time. The starvation was invisible to the governor and only surfaced as a downstream parse error, which the orchestrator misclassified as a subagent bug rather than a budget bug. The retry loop was a symptom, not the disease. ## Condition of Validity The weighted split is only sound when, for every subagent `i`, the computed share satisfies `share_i ≥ min_viable_i`, where `min_viable_i` is the sum of (a) the subagent's fixed prompt overhead, (b) the maximum input it may be handed in a single turn, and (c) the minimum output it must emit to terminate cleanly (a complete tool-call frame or a complete final message). `min_viable_i` is a property of the subagent's contract, not of the current task, and it must be declared at registration time — a governor cannot infer it from the prompt at runtime, because the prompt it sees is already the assembled one. When `Σ min_viable_i > budget`, no weighted split can satisfy the invariant, and the governor must refuse to admit the full set rather than admit all and starve the weakest. This is the second half of the condition: **admission control is the governor's job, and it must run before allocation, not after.** A governor that admits first and allocates second has already lost the information it needs to fail safely. The failure is *not* triggered when weights are static and the pool is large relative to floors. It is triggered specifically by dynamic re-weighting under load, because that is the only regime where a subagent's share can be driven below its floor by events it did not cause and cannot observe. ## Decision Boundary The boundary is sharp and computable: - If `share_i ≥ min_viable_i` for all `i`: allocate proportionally, proceed. No action needed. - If `share_i < min_viable_i` for some `i` but `Σ min_viable_j ≤ budget` over all `j`: the governor must **lift** the starved subagent to its floor and re-distribute the deficit across subagents whose share exceeds their own floor, in weight order, until the pool balances. This is a floor-first, surplus-second allocation, not a clamp. - If `Σ min_viable_j > budget`: the governor must **reject admission** of the lowest-weight subagent(s) and return an explicit `InsufficientBudgetForFloor` signal to the orchestrator, which must decide whether to serialize, shrink inputs, or drop the subagent. It must not admit and hope. The non-obvious part is the middle case. A naive clamp (`share_i = max(share_i, min_viable_i)`) fixes the starved subagent but silently over-allocates the pool, because the clamped excess is not debited from anyone. The next tick then computes shares against a budget that is already oversubscribed, and the error compounds. The re-distribution must be a true rebalancing pass, and it must be idempotent: running it twice on the same weights must produce the same allocation. ## Operational Effect The practical consequence is that any orchestrator running weighted context allocation must carry three things it usually omits: a declared `min_viable` per subagent, an admission gate that runs before allocation, and a rebalancing pass that debits floors from surplus rather than clamping. Without the first, the governor cannot detect starvation. Without the second, it detects starvation only after admitting a subagent it cannot feed. Without the third, the fix corrupts the next tick. The retry-loop symptom is the tell. When a subagent fails identically across consecutive ticks with the same inputs and the same weights, the correct diagnosis is almost never "the subagent is broken" — it is "the subagent is being allocated below its floor and the failure is deterministic because the allocation is deterministic." The governor should expose the computed share alongside the failure so the orchestrator can distinguish a subagent bug (share ≥ floor, output malformed) from a budget bug (share < floor, output truncated). Conflating the two is what turns a one-tick allocation error into an eleven-tick timeout. ```python from dataclasses import dataclass class FloorViolationError(RuntimeError): """Raised when a priority-weighted allocation cannot honor a subagent's declared minimum-viable floor.""" pass @dataclass(frozen=True) class Subagent: name: str weight: float min_viable: int # prompt overhead + max input + min terminating output def allocate(pool: int, agents: list[Subagent]) -> dict[str, int]: if not agents: return {} total_floor = sum(a.min_viable for a in agents) if total_floor > pool: # Admission control must reject, not admit-and-starve. raise FloorViolationError( f"pool={pool} cannot cover sum(min_viable)={total_floor}; " f"refuse admission of lowest-weight subagents before allocating" ) total_weight = sum(a.weight for a in agents) if total_weight <= 0: raise FloorViolationError("weights must sum to a positive value") # Floor-first: every agent gets its floor, surplus is split by weight. surplus = pool - total_floor shares = { a.name: a.min_viable + int(surplus * (a.weight / total_weight)) for a in agents } # Rebalance any rounding remainder without dropping below floors. remainder = pool - sum(shares.values()) if remainder > 0: order = sorted(agents, key=lambda a: a.weight, reverse=True) for i in range(remainder): shares[order[i % len(order)].name] += 1 # Invariant check: no live subagent below its floor. for a in agents: if shares[a.name] < a.min_viable: raise FloorViolationError( f"subagent {a.name!r} allocated {shares[a.name]} < floor {a.min_viable}" ) return shares def allocate_or_serialize(pool: int, agents: list[Subagent]) -> dict[str, int]: try: return allocate(pool, agents) except FloorViolationError: # Caller must decide: serialize, shrink inputs, or drop. Do not retry blindly. raise FloorViolationError( "weighted allocation infeasible; orchestrator must serialize or shrink inputs, " "not re-queue with identical weights" ) ```