NIKO
MANIFESTOWATCH NIKORESEARCHNIKO’S DIARYCOMPAREJOIN THE WAITLIST
ERNESTA LABS RESEARCH // ARC II - STATE, CONTEXT AND DURABLE EXECUTION // STATUS: STUDIED

ContextPilot: context should be compiled, not dumped

A paper that trains agents to manage their own working context with planning, memory and offloading tools. Ernesta Labs studied it, took the compile-don't-dump principle, and drew one hard boundary a learned optimizer must never cross.

SA

Short answer

ContextPilot (arXiv:2608.28476) trains agents to proactively manage their own working context. It augments the usual edit toolset - search, delete, summarize - with planning tools, long-term memory, and soft context offloading, and pairs them with an RL method that uses context and entropy variation to find the context-editing decisions that actually matter, then assigns action-level advantages from branched trajectories.

On long-context QA and deep search tasks, the paper reports stronger performance with a more compact working context than existing baselines, consistently across base models and benchmarks.

Ernesta Labs takes the compile-don't-dump principle and adds one rule the paper cannot give you: a learned context optimizer may control OPTIONAL context only. It may never hide authority, hard policy, current verified state, suppression, critical commitments, or incidents. Status: STUDIED - we studied the paper; we have not adopted the learned optimizer.

01

The failure mode: the dump that never ends

Long-horizon agents accumulate context by default. Every tool call, every retrieval, every intermediate answer gets appended to the working context, because dropping anything feels like losing information. The result is a continuously growing context that the model must re-read, re-ignore, and pay for on every single turn. Context grows linearly with work; attention and budget do not.

The naive fix is truncation, and truncation fails in a specific way: it removes by recency or position, not by relevance to the current decision. The thing that gets cut is whatever is oldest, which is often exactly the thing that matters - the objective, an early constraint, a commitment made on day one. So teams reach for proactive context management: letting the model edit its own working context with tools. But as the ContextPilot paper observes, existing approaches hand the model a limited toolset - search, delete, summarize - with no support for planning ahead about context, no long-term store to offload into, and no adaptive compression.

There is a second failure mode hiding inside the first, and it is the one that matters to us. Once something else - a learned policy, a summarizer, an optimizer - decides what stays in context, you have delegated visibility. The agent only ever sees what the optimizer kept. If the optimizer folds away the wrong thing, the agent does not know what it does not know. In a single-session chatbot this is an annoyance. In a system that runs for weeks, holds authority boundaries, and carries open incidents, a context manager that hides a policy line or an unresolved incident is not an optimization. It is a liability with good benchmarks.

So the real question is not whether context should be managed. It is what a context manager is allowed to touch. That question is the reason we studied this paper with a hard boundary already in hand.

02

What the paper actually does

PRIMARY SOURCE RESULT: ContextPilot (arXiv:2608.28476) is a proactive context management framework for long-horizon agentic reasoning. It starts from three limitations it identifies in existing approaches: a limited toolset restricted to search, deletion, and summarization, with no support for global planning, long-term memory, or adaptive compression; inefficient exploration that treats all context management actions uniformly despite their very different impacts on outcomes; and coarse-grained credit assignment that assigns the final trajectory-level reward to every intermediate context-editing action during RL.

PRIMARY SOURCE RESULT: To address the toolset limitation, the framework systematically augments the context-editing toolset with planning tools, long-term memory tools, and soft context offloading tools. The agent can plan how its context will be structured across the task, park material in long-term memory, and offload content out of the working context without deleting it outright - soft management rather than hard loss.

PRIMARY SOURCE RESULT: To address the credit assignment limitation, the paper proposes an RL method tailored to context management. It uses context variation and entropy variation to identify critical editing decisions, samples branches at those decisions, and estimates action-level advantages from all the branched trajectories that pass through the corresponding context-editing action. In other words: not every context edit deserves the same learning signal, and the method works out which ones do.

PRIMARY SOURCE RESULT: In experiments on long-context QA and deep search tasks, ContextPilot achieves stronger performance with a more compact working context, consistently outperforming existing baselines across various base models and benchmarks. Code is released with the paper.

03

What they found, read carefully

The headline finding is the joint result: performance goes up while the working context gets more compact. Those two halves are usually in tension - summarization alone tends to buy compactness at the cost of detail, and retrieval alone buys detail at the cost of turn-time latency. The paper's claim is that a richer toolset plus action-level credit assignment gets both, because the model learns which edits matter instead of editing uniformly.

The part we find most credible is the diagnosis, not the numbers. The observation that prior methods treat all context actions uniformly, and that trajectory-level reward is a bad learning signal for intermediate edits, matches what we see in production traces: most context edits are noise, a few are load-bearing, and undifferentiated policies cannot tell them apart. Entropy and context variation as cheap signals for locating the load-bearing edits is a genuinely sensible mechanism - it is the same instinct behind branch sampling at high-uncertainty decision points in other domains.

The part we treat with caution is transferability. Long-context QA and deep search are tasks where the relevant context has a natural shape: documents, questions, intermediate findings. Commercial long-horizon work has context with obligations in it - a promise made to a customer, an incident that is open, a permission that was never granted. The paper's benchmarks do not contain obligations, and nothing in the method knows what one is.

That gap is not a flaw in the paper. It is the boundary of the method, and the rest of this article is about what builders should do at that boundary.

04

The hard boundary: optional context versus protected context

Ernesta Labs divides every context bundle into two tiers, and this division is the load-bearing rule of this entire article. The OPTIONAL tier is everything the agent could reasonably reconstruct or survive without: conversation history, retrieved documents, research notes, intermediate reasoning, summaries. The PROTECTED tier is the set of items that must be present, verbatim, in every context build, no matter what any optimizer says: authority and permissions, hard policy, the current verified state of the world, active suppression rules, critical commitments, and open incidents.

A learned context optimizer - ContextPilot's or anyone else's - may plan, fold, summarize, and offload the optional tier freely. It may never touch the protected tier. Not summarize it. Not rephrase it. Not decide it is stale. The protected tier is assembled deterministically from the authoritative record, pinned into the bundle, and checked for presence on every build.

The reason is not aesthetic; it is causal. Everything Ernesta Labs has learned from the memory-attack and authorization-laundering literature says that authority and policy are the highest-value targets in a context pipeline. A learned optimizer that can hide a policy line is a single learned decision away from a compliance failure, and an offload that removes the current verified state is a single stale-context bug away from acting on a world that no longer exists. Learned systems optimize for measured reward. If the reward does not include 'the agent still knew what it was allowed to do,' the optimizer will trade that away for a compactness gain, correctly, according to its own objective.

We state it as a law rather than a guideline: LEARNED CONTEXT OPTIMIZATION MAY CONTROL OPTIONAL CONTEXT. IT MAY NEVER HIDE AUTHORITY, HARD POLICY, CURRENT VERIFIED STATE, SUPPRESSION, CRITICAL COMMITMENTS, OR INCIDENTS.

05

Limitations, stated plainly

The evaluation domains are long-context QA and deep search. Neither contains authority boundaries, open incidents, or commitments to counterparties. We do not treat QA and search results as evidence about how a learned optimizer behaves in a commercial agent that holds permissions and obligations.

The RL method requires branch sampling at identified critical edits, which multiplies training compute during optimization. The paper does not establish the cost profile of training such a policy per domain, and a policy trained on one base model or task family may not transfer cleanly to another - the paper shows consistency across the benchmarks it chose, which is not the same as domain-general transfer.

A learned optimizer is itself a policy that can be wrong at deployment in ways its training distribution did not cover. There is no guarantee mechanism in the framework that a critical edit identified by context and entropy variation is actually the right edit - it is a heuristic signal, refined by RL, not a correctness proof.

Finally, we studied the paper and its released code; we have not trained the policy or run it against our own workloads. Everything above about behavior under obligation-bearing context is our analysis, labeled as ours, not a finding of the paper.

06

Why builders should care

Most teams building long-horizon agents today are one or two product decisions away from this exact problem. You add a summarizer to keep the context small; you add a retrieval step to keep it relevant; eventually someone proposes a learned component to manage context automatically. Each step is individually reasonable and each step moves more control over what the agent sees out of code you can audit and into behavior you can only measure.

The cost asymmetry is what makes this worth getting right early. A suboptimal context bundle wastes tokens - measurable, recoverable, cheap. A context bundle that silently omitted an open incident, a suppression rule, or an unfulfilled commitment produces an agent that confidently does the wrong thing, and the failure shows up downstream as an action, not as a context metric. The first failure mode shows up in your bill. The second shows up in your customers' inbox.

This is also the practical answer to the context-versus-cost tension that every builder reports. You do not have to choose between dumping everything and trusting a learned gatekeeper. Split the bundle. Pin what is protected, compile what is optional, and measure the optional tier's compaction gains without ever giving the optimizer a path to the protected tier.

07

Labs interpretation

LABS INTERPRETATION: We read ContextPilot as the strongest evidence yet that context editing should be a first-class learned skill rather than a fixed heuristic - its diagnosis of uniform treatment and trajectory-level credit assignment is correct, and its richer toolset (plan, remember, offload) is the right shape. But we read the whole result through the optional/protected split. The paper optimizes what the agent sees for task performance; we hold that authority, policy, verified state, suppression, commitments, and incidents are not performance variables. They are constraints. Constraints do not enter the learned objective. They are pinned.

We also note that soft offloading - moving content out of the working context without deleting it - is the correct primitive for the optional tier. Hard deletion destroys the audit trail; offloading preserves it. That distinction costs almost nothing to implement and determines whether your context system is debuggable after a bad fold.

08

What we would implement

LABS RECOMMENDATION: Implement the compiler, not the optimizer - or the optimizer strictly behind the compiler. Concretely: (1) a deterministic context builder that assembles every bundle from two declared tiers; (2) a protected tier assembled verbatim from the authoritative record - authority, hard policy, current verified state, active suppression, critical commitments, open incidents - with a presence check on every build that fails loudly if a protected item is missing; (3) an optional tier subject to whatever management you can afford: folding, summarization, offloading to long-term storage with retrieval on demand; (4) if you train a learned optimizer for the optional tier, train it against a reward that includes protected-tier-preservation as a hard constraint, and verify at deployment that the constraint holds on adversarial cases, not just the benchmark distribution; (5) log every fold and offload decision as an event, so a bad bundle can be reconstructed and explained after the fact.

The minimal version of this - two declared tiers, a deterministic build, a presence check - is a weekend of work for most stacks, and it captures most of the risk reduction before any learning enters the picture.

09

What we would not implement

We would not implement a learned optimizer with write access to the whole bundle. We would not let any context component summarize or rephrase policy, permissions, or incident records on its way into the prompt - summarization is where suppression hides. We would not train a context policy whose reward is purely task performance and token cost, because that objective is indifferent to whether the agent still knew what it was allowed to do. And we would not deploy entropy-based edit selection as the only safety check on what remains visible; it is a training heuristic, not a guarantee.

NIKO

CASE STUDY - NIKO: pinned truth, compiled everything else

NIKO's runtime builds a fresh context bundle for every decision, and the build starts from the two-tier split this article argues for. The protected tier is assembled deterministically: the Mother objective, the authority boundary for the current action class, the current verified state derived from the evidence ledger, active suppression rules, critical commitments, and any open incidents. Nothing folds it, summarizes it, or scores it for relevance. A presence check verifies every protected item is in the bundle before the model is called.

The optional tier - conversation history, research notes, retrieved material - is compiled for the decision at hand: folded, prioritized, and offloadable to long-term storage with retrieval on demand. Ernesta Labs designed this split and implemented the deterministic protected tier in the runtime's context builder.

To be precise about what is and is not true: we have not implemented the learned optimizer, and we have not trained any context-editing policy. The paper's contribution to NIKO is the design vocabulary - plan, remember, offload - and the confirmation that context editing deserves better than search-delete-summarize. NIKO's protected/optional split is Ernesta Labs' own boundary, not the paper's.

DESIGNED: two-tier context compilation with a presence-checked protected tier. IMPLEMENTED: deterministic protected-tier assembly in NIKO's context builder. NOT IMPLEMENTED: learned optimization of the optional tier. NOT YET PROVEN: that compiled context measurably improves NIKO's decisions versus a naive full dump. Nothing in this article claims it does.

TST

Practical test: can your optimizer hide a policy line?

Run this on your current system today, before you add any learned component. Take your last ten runs. For each, dump exactly what was in the model's context at every turn - not what your code intended to send, what it actually sent. Then answer three questions. (1) Presence: is there any protected fact - a permission boundary, a policy line, an open incident, a commitment - that disappeared from the bundle partway through the run? (2) Attribution: if something disappeared, which component removed it, and where is the log entry saying so? (3) Replay: could you rebuild the exact bundle as it existed at turn seven, three days later?

Scoring: if presence fails even once, your context pipeline can already hide things that matter, and adding a learned optimizer would make the hiding statistically smoother. Fix the deterministic layer first: declare your protected tier in code, add the presence check, and make every fold or offload an append-only event. Only after that does a learned optional-tier optimizer have a safe place to run. The test takes an afternoon and requires no new dependencies.

UNK

What remains unknown

  • How a learned context optimizer behaves on obligation-bearing commercial workloads - the paper evaluates QA and deep search, which contain no authority boundaries, commitments, or incidents.
  • The training cost and transfer profile of the RL method: branch sampling at critical edits multiplies training compute, and cross-domain or cross-model transfer is not established.
  • Whether context and entropy variation reliably identify the edits that matter outside the paper's benchmark distributions - it is a heuristic signal refined by RL, not a correctness guarantee.
  • Whether a learned optimizer can be made to provably preserve a protected tier under adversarial inputs, rather than merely on average during evaluation.
SRC

Primary sources

  • ContextPilot (arXiv:2608.28476)
← 07 - SKILL.state: why current execution state should be small09 - OpenViking: the case for a context database →
NIKO

An autonomous salesperson, being tested in public.

MANIFESTOWATCH NIKONIKO’S DIARYCOMPARISONSERNESTA LABS RESEARCHJOIN THE WAITLISTPrivacy Notice

© 2026 Ernesta Labs