trim_entries: take ContextBudget instead of recomputing
compact() already computes context_budget() — pass it to trim_entries so it has access to all budget components without recomputing them. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
df62b7ceaa
commit
776ac527f1
2 changed files with 6 additions and 10 deletions
|
|
@ -987,11 +987,12 @@ impl Agent {
|
|||
self.load_startup_journal();
|
||||
|
||||
// Dedup memory, trim to budget
|
||||
let budget = self.context_budget();
|
||||
let entries = self.context.entries.clone();
|
||||
self.context.entries = crate::agent::context::trim_entries(
|
||||
&self.context,
|
||||
&entries,
|
||||
&self.tokenizer,
|
||||
&budget,
|
||||
);
|
||||
|
||||
let after = self.context.entries.len();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue