runner: context-aware memory tracking
Memory tools now dispatch through a special path in the runner (like working_stack) instead of the generic tools::dispatch. This gives them &mut self access to track loaded nodes: - memory_render/memory_links: loads MemoryNode, registers in context.loaded_nodes (replace if already tracked) - memory_write: refreshes existing tracked node if present - All other memory tools: dispatch directly, no tracking needed The debug screen (context_state_summary) now shows a "Memory nodes" section listing all loaded nodes with version, weight, and link count. This is the agent knowing what it's holding — the foundation for intelligent refresh and eviction. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
2c61a3575d
commit
4b97bb2f2e
3 changed files with 89 additions and 1 deletions
|
|
@ -102,7 +102,7 @@ pub async fn dispatch(
|
|||
"grep" => grep::grep(args),
|
||||
"glob" => glob_tool::glob_search(args),
|
||||
"journal" => journal::write_entry(args),
|
||||
n if n.starts_with("memory_") => memory::dispatch(n, args, None),
|
||||
// memory_* tools are dispatched in runner.rs for context tracking
|
||||
_ => Err(anyhow::anyhow!("Unknown tool: {}", name)),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue