diff --git a/src/agent/mod.rs b/src/agent/mod.rs index cb50568..bc62955 100644 --- a/src/agent/mod.rs +++ b/src/agent/mod.rs @@ -583,20 +583,9 @@ impl Agent { } pub async fn compact(&self) { - match crate::config::reload_context().await { - Ok(personality) => { - let mut ctx = self.context.lock().await; - // System section (prompt + tools) set by new(), don't touch it - ctx.clear(Section::Identity); - for (name, content) in &personality { - ctx.push_no_log(Section::Identity, AstNode::memory(name, content)); - } - } - Err(e) => { - dbglog!("warning: failed to reload identity: {:#}", e); - } - } - + // Identity section is left in place — mid-session rebuilds discard + // memory scores. Content edits to personality nodes get picked up at + // the next restart via new() + restore_from_log(). self.load_startup_journal().await; self.context.lock().await.trim_conversation();