Roo-Code/src/core/assistant-message
Daniel 6d2459c7e8
feat: add disabledTools setting to globally disable native tools (#11277)
* feat: add disabledTools setting to globally disable native tools

Add a disabledTools field to GlobalSettings that allows disabling specific
native tools by name. This enables cloud agents to be configured with
restricted tool access.

Schema:
- Add disabledTools: z.array(toolNamesSchema).optional() to globalSettingsSchema
- Add disabledTools to organizationDefaultSettingsSchema.pick()
- Add disabledTools to ExtensionState Pick type

Prompt generation (tool filtering):
- Add disabledTools to BuildToolsOptions interface
- Pass disabledTools through filterSettings to filterNativeToolsForMode()
- Remove disabled tools from allowedToolNames set in filterNativeToolsForMode()

Execution-time validation (safety net):
- Extract disabledTools from state in presentAssistantMessage
- Convert disabledTools to toolRequirements format for validateToolUse()

Wiring:
- Add disabledTools to ClineProvider getState() and getStateToPostToWebview()
- Pass disabledTools to all buildNativeToolsArrayWithRestrictions() call sites

EXT-778

* fix: check toolRequirements before ALWAYS_AVAILABLE_TOOLS

Moves the toolRequirements check before the ALWAYS_AVAILABLE_TOOLS
early-return in isToolAllowedForMode(). This ensures disabledTools
can block always-available tools (switch_mode, new_task, etc.) at
execution time, making the validation layer consistent with the
filtering layer.
2026-02-06 15:51:18 -08:00
..
__tests__ refactor(read_file): Codex-inspired read_file refactor EXT-617 (#10981) 2026-01-29 15:16:32 -07:00
index.ts chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00
NativeToolCallParser.ts fix: remove noisy console.warn logs from NativeToolCallParser (#11264) 2026-02-06 11:18:46 -08:00
presentAssistantMessage.ts feat: add disabledTools setting to globally disable native tools (#11277) 2026-02-06 15:51:18 -08:00
types.ts chore: remove XML tool calling support (#10841) 2026-01-20 20:25:08 -05:00