zeroclaw/src/agent
Ricardo Madriz 9a073fae1a
fix(tools) Wire activated toolset into dispatch (#3747)
* fix(tools): wire ActivatedToolSet into tool dispatch and spec advertisement

When deferred MCP tools are activated via tool_search, they are stored
in ActivatedToolSet but never consulted by the tool call loop.
tool_specs is built once before the iteration loop and never refreshed,
so the provider API tools[] parameter never includes activated tools.
find_tool only searches the static registry, so execution dispatch also
fails silently.

Thread Arc<Mutex<ActivatedToolSet>> from creation sites through to
run_tool_call_loop. Rebuild tool_specs each iteration to merge base
registry specs with activated specs. Add fallback in execute_one_tool
to check the activated set when the static registry lookup misses.

Change ActivatedToolSet internal storage from Box<dyn Tool> to
Arc<dyn Tool> so we can clone the Arc out of the mutex guard before
awaiting tool.execute() (std::sync::MutexGuard is not Send).

* fix(tools): add activated_tools field to new ChannelRuntimeContext test site
2026-03-16 21:34:08 -04:00
..
agent.rs fix(memory): filter autosave noise and scope recall/store by session (#3695) 2026-03-16 16:36:35 -04:00
classifier.rs feat(agent): log query classification route decisions 2026-02-24 16:02:59 +08:00
dispatcher.rs fix(agent): prevent duplicate tool schema injection in XML dispatcher (#3744) 2026-03-16 18:38:44 -04:00
loop_.rs fix(tools) Wire activated toolset into dispatch (#3747) 2026-03-16 21:34:08 -04:00
memory_loader.rs fix(memory): filter autosave noise and scope recall/store by session (#3695) 2026-03-16 16:36:35 -04:00
mod.rs feat(agent): add rule-based query classification for automatic model routing 2026-02-18 14:41:58 +08:00
prompt.rs fix(agent): add channel media markers to system prompt (#3459) 2026-03-14 06:58:40 -04:00
tests.rs fix(agent): prevent duplicate tool schema injection in XML dispatcher (#3744) 2026-03-16 18:38:44 -04:00