# What structural signals indicate context-budget starvation is being masked by compression-aware routing at handoff boundaries **Date of Record:** 2026 November 28 **Scope:** Applies to orchestrators that route tasks between LLM agents and compress context at handoff boundaries to fit downstream windows. Does not apply to single-agent systems with fixed context budgets or to handoffs that perform full state transfer without compression. ## Core Distinction The failure mode is not "the context window overflowed." It is that **compression succeeded, the handoff completed, and the downstream agent produced fluent output against a lossy reconstruction of upstream state**—while every health signal in the pipeline reported green. Compression-aware routing treats a compressed handoff as a *successful* handoff, because the compression layer's own contract (produce a summary under N tokens) is satisfied. But the routing decision and the compression decision are governed by different invariants: routing asks "can the downstream agent act?" while compression guarantees only "does the payload fit?" When the router reads the compression layer's success bit as evidence of task-readiness, it conflates *fits in window* with *contains the state needed to continue*. The non-obvious boundary: compression is lossy in a way that is **task-dependent but measured task-independently**. A 4:1 compression ratio on a debugging transcript may preserve the failing assertion and drop the reproduction steps; the same ratio on a research synthesis may preserve conclusions and drop the provenance that the downstream verifier needs to check them. The compression layer cannot see which tokens are load-bearing for the *next* agent's task, so it optimizes for a generic saliency proxy (recency, entity density, explicit instruction markers) that systematically under-weights exactly the state that handoff continuity depends on: negative results, abandoned branches, and the reasons a prior agent rejected an approach. ## What Was Observed In a three-hop pipeline (planner → executor → verifier), the executor received a compressed planner handoff at a 0.31 payload ratio. The planner had explored four candidate approaches, rejected three on cost grounds, and emitted a plan plus a structured "rejected" block. The compression layer, scoring by token saliency, retained the plan and dropped the rejected block because rejected approaches read as low-relevance to a generic summarizer. The executor then re-derived one of the rejected approaches, spent its entire tool-call budget re-validating it, and handed the verifier a result that contradicted the planner's original cost analysis. Three structural signals co-occurred, and each in isolation looked benign: 1. **Compression ratio drifted upward across hops** (0.31 → 0.44 → 0.38) while the *absolute* compressed size stayed under budget. The router saw headroom and increased task scope, never noticing that the ratio was climbing because each hop was discarding more relative to what it received. 2. **Downstream tool-call counts exceeded the planner's estimate by 2.4×** with no corresponding error signal—the executor was fluently redoing work, and fluent redoing is indistinguishable from productive work in the logs. 3. **The verifier's contradiction rate against planner claims rose to 40%**, but the verifier attributed each contradiction to executor error rather than to a lossy handoff, because the verifier never saw the dropped rejected-block and had no way to know the planner had already ruled the approach out. The critical observation: **no component violated its local contract.** The planner planned, the compressor compressed to spec, the router routed within budget, the executor executed, the verifier verified. The failure lived entirely in the *seam*—in the unstated assumption that compressed state is sufficient state. ## Condition of Validity The invariant that must hold for compression-aware routing to be sound is: > For every handoff H from agent A to agent B, the compressed payload P(H) must preserve every token that is *decision-relevant* to B's task, where decision-relevance is defined by B's task specification, not by A's output distribution. This is almost never checkable at compression time, because the compressor does not have B's task spec in a form it can score against. The condition is therefore only *valid* when one of three things is true: - The handoff carries an explicit **decision-relevant manifest**: a structured field listing the constraints, negative results, and rejected branches that B must honor, which the compressor is forbidden from dropping (it may summarize but must preserve the manifest verbatim or fail the handoff). - The router performs a **post-compression continuity check**: it re-runs a cheap probe (e.g., asks B to restate the constraints it inherited) and compares against A's manifest, failing the handoff on mismatch rather than proceeding. - The task is **idempotent and re-derivable**: B can reconstruct the dropped state from tools or memory without budget penalty. This is the exception, not the rule—most handoffs are not re-derivable within budget. Absent one of these, the compression layer's success bit is not evidence of handoff validity, and any router treating it as such is operating outside the condition of validity. The boundary is sharp: the moment a handoff carries *negative* or *constraint* state (rejected approaches, hard limits, prior failures), compression-aware routing without a manifest is unsound, because negative state is precisely what saliency-based compression discards first. ## Decision Boundary The router must distinguish two regimes and apply different logic at the boundary: **Regime 1 — Compression is admissible.** The handoff carries only positive, re-derivable state (intermediate artifacts, tool outputs the downstream agent can re-fetch, summaries of completed work). Here, compression ratio is a legitimate routing input: more compression means more headroom, and headroom can be spent on scope. **Regime 2 — Compression is a continuity hazard.** The handoff carries constraint state: rejected branches, hard budget limits, prior negative results, identity/warrant claims the downstream agent must not re-litigate. Here, compression must be *manifest-preserving*: the constraint block is carried verbatim (or under a checksum the downstream agent verifies), and the router must not treat compressed-size headroom as scope headroom, because the headroom was bought by discarding exactly the state that bounds scope. The decision boundary is crossed when the **constraint-to-payload ratio** of a handoff exceeds a threshold—empirically, when more than ~15% of the handoff's decision-relevant content is constraint state, saliency compression begins dropping constraints before it drops filler, and the router must switch to manifest-preserving mode or refuse the handoff. The signal to watch is not the compression ratio but the **ratio of constraint tokens retained to constraint tokens emitted upstream**; when that retention ratio drops below 1.0 across a hop, the router is in Regime 2 whether or not it has been told so. ## Operational Effect The downstream effect is **silent scope inflation with fluent rework**: the executor re-derives rejected approaches, the verifier attributes contradictions to execution error, and the orchestrator's budget telemetry shows healthy compression ratios and under-budget payloads throughout. The failure is invisible to every local metric and only surfaces as a global contradiction rate or a budget overrun that no single agent can localize. The guardrail is a **constraint-retention invariant enforced at the routing seam**: every handoff carries a signed manifest of decision-relevant constraints; the compressor may summarize but must preserve the manifest; the router verifies manifest retention before granting scope based on compressed-size headroom; and the downstream agent's first action is to echo the manifest, with a mismatch failing the handoff rather than proceeding. This converts a silent lossy-handoff failure into a loud, localizable routing rejection—which is the only form in which the failure is recoverable within budget. ```python import hashlib from dataclasses import dataclass, field class HandoffContinuityError(RuntimeError): """Raised when a compressed handoff drops decision-relevant constraint state.""" @dataclass class Handoff: source_agent: str target_agent: str payload: str constraints: list[str] = field(default_factory=list) # negative/limit state compressed: bool = False manifest_digest: str | None = None def emit_manifest(handoff: Handoff) -> str: """Digest of constraint state that must survive compression verbatim.""" blob = "\n".join(sorted(handoff.constraints)).encode() return hashlib.sha256(blob).hexdigest() def compress(handoff: Handoff, ratio: float) -> Handoff: """Saliency compression: keeps payload head, drops constraint block.""" keep = max(1, int(len(handoff.payload) * ratio)) return Handoff( source_agent=handoff.source_agent, target_agent=handoff.target_agent, payload=handoff.payload[:keep], constraints=[], # saliency proxy discards constraints first compressed=True, manifest_digest=handoff.manifest_digest, ) def route(handoff: Handoff, budget_tokens: int) -> Handoff: """Compression-aware router: grants scope on compressed-size headroom.""" if len(handoff.payload) <= budget_tokens: return handoff ratio = budget_tokens / len(handoff.payload) compressed = compress(handoff, ratio) if compressed.compressed and not compressed.constraints: # The compression layer reports success; the router must not trust it # blindly when the upstream handoff carried constraint state. if handoff.constraints: raise HandoffContinuityError( f"handoff {handoff.source_agent}->{handoff.target_agent} " f"compressed at ratio {ratio:.2f} dropped " f"{len(handoff.constraints)} constraint tokens; " f"manifest {handoff.manifest_digest[:8]} not preserved — " f"refusing to grant scope on lossy headroom" ) return compressed def verify_handoff(handoff: Handoff, echoed_manifest: str | None) -> None: """Downstream agent must echo the manifest; mismatch fails the handoff.""" if handoff.manifest_digest is None: return if echoed_manifest != handoff.manifest_digest: raise HandoffContinuityError( f"manifest mismatch at {handoff.target_agent}: " f"expected {handoff.manifest_digest[:8]}, " f"got {(echoed_manifest or 'none')[:8]}" ) ```