mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-01 23:59:55 +08:00
CallToolTool answered every unforwarded call with "load it first". That was wrong for a tool already in tools[] (an MCP tool, a built-in) and for malformed arguments, and for the former it sent the model round in a loop. DeferredToolLoader.proxy_refusal now names the reason (missing name, call_tool itself, already in the tool list, proxy off, unknown, not loaded) and proxy_arguments checks the arguments: an object, or a string holding valid JSON for one; anything else is refused. The pipeline's _resolve_proxied_tool_calls and CallToolTool both go through proxy_call_refusal, so the message matches the decision. Setup tools loaded through load_tools are proxied. Opening setup mode later left them proxied: not in tools[], no rules (already loaded), and a note that never mentioned call_tool. An opened mode's tools are now made native, like mastery's outline tools; a setup turn whose tools are still proxied gets a hint to reach them through call_tool. Also: call_tool is mounted only when the loader has built-in/capability tools to proxy; its manifest order no longer duplicates load_tools'; a forwarded call without an id is not marked for renaming. Refs #2972