mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 18:49:49 +08:00
Follow-up refinements on top of #579 (deny MCP tools until explicitly granted), tightening decoupling and front/back consistency: - Decouple: extract the duplicated `metadata.source == "partner"` check (deferred-tools, exec gate, tool composition, cron owner routing) into a single `AgenticChatPipeline._is_partner_turn` helper, so the partner authority-via-metadata contract has one definition instead of four inline copies. - Frontend parity: the backend now denies MCP for non-admin users when the grant omits `mcp_tools`, but GrantEditor still showed `null` as "Default · all" / "all MCP". Make ModeSwitch's default-mode label caller-supplied, label the MCP section "Default · none" / "no MCP", and add a one-line rationale so admins are not misled into granting nothing. Built-in optional tools keep `null = all`; only MCP tools fail closed. Tests: ruff clean; pytest multi_user/mcp/partners/chat (545 passed); web tsc + eslint clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>