mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 03:39:27 +08:00
* fix: sync partner tool list with global chat tool toggles When a user disables a toggleable tool (web_search, brainstorm, paper_search, reason) in Settings → Chat → Tools, partners must respect that choice in both the Mind tool picker and at runtime. Previously the picker showed the full USER_TOGGLEABLE_TOOL_NAMES pool and defaulted every tool to enabled, and the runtime intersected only with the partner's own config — so a globally-disabled tool could still be picked and executed inside a partner. Changes: - deeptutor/agents/_shared/tool_composition.py Add admin_enabled_optional_tools() that reads the admin's interface.json directly (partners run in a synthetic scope, so get_enabled_optional_tools() would read the wrong settings file). Fails open to the full toggleable set on missing/unreadable file. - deeptutor/api/utils/tool_options.py build_tool_options() now filters the tools list against admin_enabled_optional_tools(), so globally-disabled tools do not appear in the Mind step picker and are excluded from the default 'select all' set. - deeptutor/services/partners/runtime.py _resolved_enabled_tools() intersects the partner's configured (or defaulted) whitelist with admin_enabled_optional_tools(), so a globally-disabled tool can never run inside a partner turn. - tests/services/partners/test_partner_runtime.py Three new tests covering: explicit config intersection, default config intersection, and fail-open on missing admin settings. - tests/api/test_partners_router.py New test verifying tool-options endpoint honors global chat toggles. Closes: Partner tool picker and runtime drift from global chat tool switches * fix(pre-commit): apply ruff import sorting * fix: scope optional tool filtering to partner surfaces --------- Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>