estimate prompt tokens on restore so status bar isn't 0K

After restore_from_log + compact, set last_prompt_tokens from
the budget's used() count instead of waiting for the first API call.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 23:07:42 -04:00
parent 41b3f50c91
commit 31302961e2

View file

@ -1003,6 +1003,9 @@ impl Agent {
all.len(), mem_count, conv_count); all.len(), mem_count, conv_count);
self.context.entries = all; self.context.entries = all;
self.compact(); self.compact();
// Estimate prompt tokens from budget so status bar isn't 0 on startup
let b = self.budget();
self.last_prompt_tokens = b.used() as u32;
true true
} }