Skip to content

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

Rust

fix(capture): keep invalid-marker diagnostics panic-free (#1021)

AkitaOnRails0966ecc230f2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 713fbf80..bbbfa658 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
based on the same resolution state the live hook path uses (not just
whether the TOML parses), so it also catches a `[capture]` table that
parses fine but is still rejected at compile time, e.g. an unsupported glob
- character in `ignore_paths`.
+ character in `ignore_paths`. (#1021)
## [2.5.2] - 2026-10-01
diff --git a/crates/ai-memory-hooks/src/capture_policy.rs b/crates/ai-memory-hooks/src/capture_policy.rs
index 55a72c29..851585f2 100644
--- a/crates/ai-memory-hooks/src/capture_policy.rs
+++ b/crates/ai-memory-hooks/src/capture_policy.rs
@@ -1086,10 +1086,11 @@ fn compile(
validate_glob(source)
.map_err(|reason| format!("ignore_paths entry {source:?} {reason}"))?;
let expanded = if let Some(rest) = source.strip_prefix("~/") {
- join(
- home.as_deref().expect("needs_home found this pattern"),
- rest,
- )
+ let home = home.as_deref().ok_or_else(|| {
+ "a pattern starts with '~/' but no home directory is available to expand it"
+ .to_owned()
+ })?;
+ join(home, rest)
} else if is_absolute(source) {
source.clone()
} else {