Skip to content

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

Rust

style: rustfmt the profile filter and test landed in #1678

AkitaOnRailsfd3d801c2588
diff --git a/crates/ai-memory-consolidate/src/profile.rs b/crates/ai-memory-consolidate/src/profile.rs
index bc5fd6ff..5707feea 100644
--- a/crates/ai-memory-consolidate/src/profile.rs
+++ b/crates/ai-memory-consolidate/src/profile.rs
@@ -691,8 +691,7 @@ fn has_marker(sentence: &str) -> bool {
let padded = padded_lower(sentence);
PREFERENCE_MARKERS.iter().any(|m| has_phrase(&padded, m))
&& !looks_agent_written(sentence)
- && !(forgoes_a_capability(&padded)
- && generality_of(sentence) != ProfileGenerality::General)
+ && !(forgoes_a_capability(&padded) && generality_of(sentence) != ProfileGenerality::General)
}
/// Whether `padded` switches off one of the agent's own capabilities.
@@ -2815,11 +2814,15 @@ mod tests {
assert_eq!(scoped[0].generality, ProfileGenerality::General);
// And an ordinary habit that mentions no capability is untouched.
- let habits = detect_preferences("Never force-push to main. Always run clippy before a commit.");
+ let habits =
+ detect_preferences("Never force-push to main. Always run clippy before a commit.");
let statements: Vec<&str> = habits.iter().map(|f| f.statement.as_str()).collect();
assert_eq!(
statements,
- ["Never force-push to main.", "Always run clippy before a commit."]
+ [
+ "Never force-push to main.",
+ "Always run clippy before a commit."
+ ]
);
}