Files
DeepTutor/web/features
Bingxi Zhao (Frank) 5eafa0c2fb refactor(multi-user): consolidate partner-turn detection + align MCP grant UI
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>
2026-06-21 13:48:00 +08:00
..