increase context budget: 80% window, 15% journal, no double reserve

Context was too aggressively trimmed — 80% free after compaction.
Budget was 60% of window minus 25% reserve = only 45% usable.

Now: 80% of window for total budget (20% output reserve built in),
no extra reserve subtraction. Journal budget 5% → 15% to carry
more context across compactions.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 22:53:54 -04:00
parent 78abf90461
commit d921e76f82
2 changed files with 7 additions and 8 deletions

View file

@ -825,11 +825,11 @@ impl Agent {
};
dbg_log!("[journal] cutoff_idx={}", cutoff_idx);
// Walk backwards from cutoff, accumulating entries within 5% of context
// Walk backwards from cutoff, accumulating entries within 15% of context
let count = |s: &str| self.tokenizer.encode_with_special_tokens(s).len();
let context_window = crate::thought::context::context_window();
let journal_budget = context_window * 5 / 100;
dbg_log!("[journal] budget={} tokens ({}*5%)", journal_budget, context_window);
let journal_budget = context_window * 15 / 100;
dbg_log!("[journal] budget={} tokens ({}*15%)", journal_budget, context_window);
let mut entries = Vec::new();
let mut total_tokens = 0;