Output tool via Arc<Mutex<Subconscious>> closure — complete
ToolHandler is now Arc<dyn Fn(...)> supporting closures that capture state. The output tool is created during init_output_tool() as a closure capturing Arc<Mutex<Subconscious>>, writing directly to Subconscious.state. No more POC_AGENT_OUTPUT_DIR filesystem hack. - All tool handlers wrapped in Arc::new() - Tool is Clone (not Copy) — .copied() → .cloned() - Subconscious wrapped in Arc<Mutex<>> on Mind - Dead filesystem-based output() function removed - memory_tools returns 11 items (output removed from static list) Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
daba424a46
commit
dd85a56902
13 changed files with 14 additions and 16 deletions
|
|
@ -143,7 +143,7 @@ pub async fn dispatch_with_agent(
|
|||
let tool = if let Some(ref a) = agent {
|
||||
// Only dispatch tools the agent is allowed to use
|
||||
let guard = a.state.lock().await;
|
||||
guard.tools.iter().find(|t| t.name == name).copied()
|
||||
guard.tools.iter().find(|t| t.name == name).cloned()
|
||||
} else {
|
||||
// No agent context — allow all tools (CLI/MCP path)
|
||||
tools().into_iter().find(|t| t.name == name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue