File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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" ,
Original file line number Diff line number Diff 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.
166166pub 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" ) )
Original file line number Diff line number Diff 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 ( "\n stop " ) ;
83+ let stop_imperative =
84+ lower. starts_with ( "stop " ) || lower. contains ( ". stop " ) || lower. contains ( "\n stop " ) ;
8685 if !( lower. contains ( "never " ) || lower. contains ( "don't " ) || lower. contains ( "do not " ) )
8786 && !stop_imperative
8887 {
Original file line number Diff line number Diff line change 3434pub mod capture;
3535pub mod prompt;
3636pub mod store;
37- pub mod types;
3837#[ cfg( test) ]
3938pub mod test_helpers;
39+ pub mod types;
4040
4141pub use capture:: ToolMemoryCaptureHook ;
4242pub use prompt:: { render_tool_memory_rules, ToolMemoryRulesSection , TOOL_MEMORY_HEADING } ;
Original file line number Diff line number Diff line change @@ -144,7 +144,9 @@ fn priority_marker(priority: ToolMemoryPriority) -> &'static str {
144144#[ cfg( test) ]
145145mod 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 {
You can’t perform that action at this time.
0 commit comments