Skip to content

Commit 492d8e3

Browse files
style(memory): apply cargo fmt to tool-scoped memory changes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cd86784 commit 492d8e3

5 files changed

Lines changed: 12 additions & 11 deletions

File tree

src/openhuman/agent/harness/session/builder.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -845,9 +845,7 @@ impl Agent {
845845
post_turn_hooks.push(Arc::new(
846846
crate::openhuman::memory::ToolMemoryCaptureHook::new(memory.clone(), true),
847847
));
848-
log::info!(
849-
"[learning] tool_memory_capture hook registered"
850-
);
848+
log::info!("[learning] tool_memory_capture hook registered");
851849
}
852850
}
853851

@@ -990,8 +988,7 @@ impl Agent {
990988
if config.learning.enabled && config.learning.tool_memory_capture_enabled {
991989
let agent_tool_names: Vec<String> =
992990
tools.iter().map(|t| t.name().to_string()).collect();
993-
let pinned =
994-
prefetch_tool_memory_rules_blocking(memory.clone(), &agent_tool_names);
991+
let pinned = prefetch_tool_memory_rules_blocking(memory.clone(), &agent_tool_names);
995992
if !pinned.is_empty() {
996993
log::info!(
997994
"[memory::tool_memory] pinning {} tool-scoped rule(s) into system prompt",

src/openhuman/memory/ops/tool_memory.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ pub async fn tool_rules_for_prompt(
164164
/// Render the raw JSON form of a tool's rules, useful for envelope
165165
/// consumers that want the unfiltered list.
166166
pub async fn tool_rules_json(params: ToolRuleListParams) -> Result<RpcOutcome<Value>, String> {
167-
log::debug!("[tool-memory] rpc tool_rules_json tool={}", params.tool_name);
167+
log::debug!(
168+
"[tool-memory] rpc tool_rules_json tool={}",
169+
params.tool_name
170+
);
168171
let store = open_store().await?;
169172
let value = store.list_rules_json(&params.tool_name).await?;
170173
Ok(RpcOutcome::single_log(value, "tool memory rules json"))

src/openhuman/memory/tool_memory/capture.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ impl ToolMemoryCaptureHook {
8080
// Only treat "stop" as an imperative edict when it appears at a
8181
// sentence boundary (start of message or after ". "/"\n"), so routine
8282
// phrases like "I want to stop working" don't trigger false captures.
83-
let stop_imperative = lower.starts_with("stop ")
84-
|| lower.contains(". stop ")
85-
|| lower.contains("\nstop ");
83+
let stop_imperative =
84+
lower.starts_with("stop ") || lower.contains(". stop ") || lower.contains("\nstop ");
8685
if !(lower.contains("never ") || lower.contains("don't ") || lower.contains("do not "))
8786
&& !stop_imperative
8887
{

src/openhuman/memory/tool_memory/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
pub mod capture;
3535
pub mod prompt;
3636
pub mod store;
37-
pub mod types;
3837
#[cfg(test)]
3938
pub mod test_helpers;
39+
pub mod types;
4040

4141
pub use capture::ToolMemoryCaptureHook;
4242
pub use prompt::{render_tool_memory_rules, ToolMemoryRulesSection, TOOL_MEMORY_HEADING};

src/openhuman/memory/tool_memory/prompt.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ fn priority_marker(priority: ToolMemoryPriority) -> &'static str {
144144
#[cfg(test)]
145145
mod tests {
146146
use super::*;
147-
use crate::openhuman::agent::prompts::types::{LearnedContextData, PromptContext, ToolCallFormat};
147+
use crate::openhuman::agent::prompts::types::{
148+
LearnedContextData, PromptContext, ToolCallFormat,
149+
};
148150
use crate::openhuman::memory::tool_memory::types::ToolMemorySource;
149151

150152
fn rule(tool: &str, body: &str, priority: ToolMemoryPriority) -> ToolMemoryRule {

0 commit comments

Comments
 (0)