mind: restore age_out_images and publish_context_state after turns

These were called from handle_turn_result before the refactor but
got lost during the MindState migration. Re-add them in the turn
completion path. Delete the trivial refresh_context_state wrapper.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2026-04-05 03:38:42 -04:00
parent 01b07a7f28
commit 402bae4178
3 changed files with 9 additions and 8 deletions

View file

@ -851,10 +851,6 @@ impl Agent {
}
/// Called after any change to context state (working stack, etc).
fn refresh_context_state(&mut self) {
self.publish_context_state();
}
/// Load working stack from disk.
fn load_working_stack(&mut self) {
if let Ok(data) = std::fs::read_to_string(working_stack::file_path()) {
@ -886,7 +882,7 @@ impl Agent {
/// Replace base64 image data in older messages with text placeholders.
/// Keeps the 2 most recent images live (enough for motion/comparison).
/// The tool result message before each image records what was loaded.
fn age_out_images(&mut self) {
pub fn age_out_images(&mut self) {
// Find image entries newest-first, skip 1 (caller is about to add another)
let to_age: Vec<usize> = self.context.entries.iter().enumerate()
.rev()