multi_agent_chat/permissions: surface MCP tool metadata into ask interrupts

The FE permission card needs mcp_connector_id, mcp_server, and
tool_description in the interrupt context to render "Always Allow"
against the right connected account. Thread the tool through the
ask pipeline:

- pack_subagent → build_permission_mw(tools=...) → PermissionMiddleware
  (tools_by_name) → request_permission_decision(tool=...) →
  build_permission_ask_payload(tool=...) projects card fields out of
  BaseTool.

- mcp_tool.py: stdio path now stashes mcp_connector_id in metadata for
  parity with the HTTP path.
This commit is contained in:
CREDO23 2026-05-15 11:28:06 +02:00
parent ef1152b80e
commit a97d1548a6
7 changed files with 236 additions and 31 deletions

View file

@ -74,7 +74,7 @@ def pack_subagent(
if user_allowlist is not None:
subagent_rulesets.append(user_allowlist)
per_subagent_perm = build_permission_mw(
flags=flags, subagent_rulesets=subagent_rulesets
flags=flags, subagent_rulesets=subagent_rulesets, tools=tools
)
prepended: list[Any] = []