mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 00:59:48 +08:00
load_tools appended the loaded schema to the end of tools[]. tools[] is the first thing in the provider's prompt-cache key, so the next request of the same turn re-processed the system prompt and the whole history. When the turn mounts the new call_tool builtin, load_tools now returns the loaded tools' definitions in its result and leaves tools[] alone; the loop forwards each call_tool call to the named tool before dispatch, so the tool runs with its own argument checks, injected kwargs and trace, while the history keeps the model's own call. Tools loaded this way stay proxied for the session (loaded_tools.json gains proxied_tools). Runtime loads that must land in tools[] pass native=True; the TypeScript engine keeps the old behaviour.