feat: add overrideSystemPrompt option for custom modes#11794
Draft
roomote[bot] wants to merge 1 commit intomainfrom
Draft
feat: add overrideSystemPrompt option for custom modes#11794roomote[bot] wants to merge 1 commit intomainfrom
roomote[bot] wants to merge 1 commit intomainfrom
Conversation
When overrideSystemPrompt is true on a ModeConfig, the system prompt uses only the roleDefinition as its body, skipping all standard sections (CAPABILITIES, TOOL USE, MODES, SKILLS, RULES, SYSTEM INFO, OBJECTIVE, MARKDOWN RULES). Custom instructions from .roo/rules-* files and global settings are still appended. This gives power users full control over the system prompt for specialized workflows while maintaining backward compatibility -- the flag defaults to false/undefined so existing modes are unaffected. Closes #11793
Open
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR attempts to address Issue #11793.
Summary
Adds an
overrideSystemPromptboolean option toModeConfigthat allows custom modes to use theirroleDefinitionas the entire system prompt body, skipping all standard built-in sections (CAPABILITIES, TOOL USE, MODES, SKILLS, RULES, SYSTEM INFO, OBJECTIVE, MARKDOWN RULES).Changes
packages/types/src/mode.ts- AddedoverrideSystemPrompt: z.boolean().optional()tomodeConfigSchemasrc/core/prompts/system.ts- WhenoverrideSystemPromptis true on the resolved mode config,generatePrompt()returns only theroleDefinition+ custom instructions (from.roo/rules-*, global settings, and mode-specific instructions)src/core/prompts/__tests__/system-prompt.spec.ts- Added 4 test cases covering: override active, custom instructions still appended, override false, and override unsetUsage
{ "customModes": [ { "slug": "my-mode", "name": "My Mode", "roleDefinition": "[Complete custom system prompt]", "overrideSystemPrompt": true, "groups": ["read", "edit"] } ] }What still works with override enabled
.roo/rules-*files and global settingsWhat is skipped
Backward compatibility
overrideSystemPromptdefaults tofalse/undefined, so all existing modes behave exactly as beforeFeedback and guidance are welcome.
Interactively review PR in Roo Code Cloud