You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This wires `ToolRouter` (#577) into the task build path: when the scoped MCP tool count exceeds a threshold, only the top-K tools ranked by the initial task text are injected into the API call. The `mcp_load` escape hatch (#579) is added in the next story; this story establishes the data structure and the gate.
Add `attachedMcpToolNames: Set` to `Task` state (persisted with task history so the set survives re-attach).
In `src/core/task/build-tools.ts`: after `getMcpServerTools()` produces `mcpTools`, check `mcpTools.length` against `mcp.dynamicLoad.threshold` (new setting, default 50; replaces the existing `MAX_MCP_TOOLS_THRESHOLD = 60` in `packages/types/src/mcp.ts`).
Under threshold: existing path unchanged.
Over threshold: call `ToolRouter.attachInitial(taskText, scopedTools, initialK)`, initialise `Task.attachedMcpToolNames`, filter the API `tools` array to only attached names.
Context
This wires `ToolRouter` (#577) into the task build path: when the scoped MCP tool count exceeds a threshold, only the top-K tools ranked by the initial task text are injected into the API call. The `mcp_load` escape hatch (#579) is added in the next story; this story establishes the data structure and the gate.
Depends on #577. Part 1 of 2 — see also #579.
Partially closes: RooCodeInc/Roo-Code#11990.
Developer Notes
Acceptance Criteria