Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(consolidate): omit expired pages from curator report

Vinícius DS Andrade2c5c17d65635
diff --git a/crates/ai-memory-consolidate/src/curator.rs b/crates/ai-memory-consolidate/src/curator.rs
index 2de07b85..34a3afda 100644
--- a/crates/ai-memory-consolidate/src/curator.rs
+++ b/crates/ai-memory-consolidate/src/curator.rs
@@ -131,6 +131,9 @@ pub async fn run_curator_report_with_breadth(
if c.tier != Tier::Episodic || c.pinned || frontmatter_pinned(&c.frontmatter_json) {
continue;
}
+ if c.expires_at_us.is_some_and(|us| us <= now_us) {
+ continue;
+ }
// A2: a page already tiered down (its V65 marker set) is a deliberately
// short compacted residue, not a fresh cold candidate. The sweep will
// never touch it again, so the curator must not report it as cold —
@@ -173,7 +176,7 @@ pub async fn run_curator_report_with_breadth(
cold.sort_by(|a, b| a.message.cmp(&b.message));
findings.extend(cold.into_iter().take(params.max_findings_per_kind));
- let pages = reader.list_pages(workspace_name, project_name).await?;
+ let pages = reader.list_unexpired_pages(workspace_name, project_name).await?;
let mut stale_slots = Vec::new();
let mut titles: HashMap<String, Vec<String>> = HashMap::new();
for page in &pages {