-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
What problem does this proposed feature solve?
What problem does this proposed feature solve?*
I have already implemented this feature in PR #3171 , but it was closed for further discussion about the approach and scope.
Currently, all modes in Roo Code have unrestricted access to certain tools like creating subtasks (new_task), switching modes (switch_mode), and asking follow-up questions (ask_followup_question). This presents several untapped opportunities:
-
Structured workflow creation: With mode permissions, users could define specific workflows where modes follow a predetermined sequence (e.g., ensuring Code mode always calls Test mode for TDD practices)
-
Optimized context management: For Example: When Orchestrator creates subtask in Architect mode, Architect often tries to switch to Code mode working on the plan. It should complete the task and report back to Orchestrator instead which then creates a new subtask for Code mode.
Things like that could be prevented. -
Fully autonomous operations: Users could create modes that run without interruptions by disabling follow-up questions, enabling true autopilot experiences
-
Consistent permission patterns: Just as
fileRegexcontrols file access, mode permissions would provide the same granular control on which mode can call what on which mode.
Describe the proposed solution in detail
My implemented solution (in PR #3171) introduces a granular permission system for mode-specific tools. However, there are open questions about the scope and approach that need discussion:
1. New Permission Groups
I added three new permission groups that can be configured per mode:
subtask: Controls whether a mode can create subtasks usingnew_taskswitch: Controls whether a mode can switch to other modes usingswitch_modefollowup: Controls whether a mode can ask follow-up questions usingask_followup_question
Discussion point: Should we extend this to ALL available tools rather than just these three? This would provide maximum flexibility for users.
2. Mode Targeting Restrictions
For subtask and switch permissions, I implemented an optional slugRegex property that restricts which modes can be targeted:
["subtask", { "slugRegex": "^(code|test)$" }]e.g this allows the mode to only create subtasks in Code or Test mode.
Discussion points:
- Should we keep the regex approach or simplify to just define allowed mode slugs (e.g.,
["code", "test"])? - Should we remove this feature entirely for the initial implementation?
UI Changes
The UI now shows three new checkboxes in the Prompts settings view:
Backwards Compatibility
This is where we need to decide between approaches:
-
Whitelist approach (current implementation): New tools are removed from
ALWAYS_AVAILABLE_TOOLS, requiring migration to add them to existing custom modes -
Blacklist approach: Tools are available by default, but can be explicitly disabled
The concern is that with the whitelist approach, existing custom modes would lose access to these tools unless we implement a migration strategy.
Technical considerations or implementation details (optional)
The implementation in PR #3171 already includes:
- Schema updates: Extended the mode schema to include the new permission groups in
schemas/index.ts - Permission checking: Updated
isToolAllowedForModeinmodes.tsto:- Handle the new permission groups
- Parse tool parameters (
modeormode_slug) and validate againstslugRegex
- Tool configuration: Updated
toolGroupsintools.tsand removed these tools fromALWAYS_AVAILABLE_TOOLS - UI implementation: Updated
PromptsView.tsxto:- Display new permission checkboxes
- Interpret
slugRegexand display allowed mode names - Handle both collapsed and expanded view formatting
- Localization: Added translation keys for new permissions in all
prompts.jsonfiles - Testing: Added comprehensive test coverage for permission logic, UI changes, and schema validation
Describe alternatives considered (if any)
-
Blacklist approach: Keep tools available by default, let users explicitly disable them. This would avoid breaking existing custom modes but changes the security model from opt-in to opt-out.
-
Extend to all tools: Allow granular control over all tools (not just the three I implemented). This provides maximum flexibility but needs careful UI design to avoid clutter.
-
Simple mode list instead of regex: Replace
slugRegexwith a simple array of allowed mode slugs (e.g.,["code", "test"]). Easier to understand but less flexible. -
Remove mode targeting entirely: Start with just the boolean permissions (can/cannot use tool) without the ability to restrict target modes. Simpler initial implementation.
Additional Context & Mockups
Original PR with full implementation: #3171
Proposal Checklist
- I have searched existing Issues and Discussions to ensure this proposal is not a duplicate.
- This proposal is for a specific, actionable change intended for implementation (not a general idea).
- I understand that this proposal requires review and approval before any development work begins.
Are you interested in implementing this feature if approved?
- Yes, I would like to contribute to implementing this feature.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status

