Skip to content

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

Rust

fix(cli): show when read-page returns an expired page

Vinícius DS Andrade72c947aa5dd5
diff --git a/crates/ai-memory-cli/src/commands/read_page.rs b/crates/ai-memory-cli/src/commands/read_page.rs
index 424449ab..096a414c 100644
--- a/crates/ai-memory-cli/src/commands/read_page.rs
+++ b/crates/ai-memory-cli/src/commands/read_page.rs
@@ -28,6 +28,10 @@ struct PageContent {
title: Option<String>,
body: String,
frontmatter: serde_json::Value,
+ /// Set by the server when the page's `expires_at` TTL has passed: the
+ /// exact-path read still answers, while `search` no longer lists the page.
+ #[serde(default, skip_serializing_if = "std::ops::Not::not")]
+ expired: bool,
}
/// Run the `read-page` subcommand.
@@ -73,6 +77,9 @@ pub async fn run(config: &Config, args: ReadPageArgs) -> Result<()> {
println!("# {title}");
}
println!("path: {}", page.path);
+ if page.expired {
+ println!("expired: true");
+ }
println!();
print!("{}", page.body);
if !page.body.ends_with('\n') {