fix: enhance addCustomInstructions to prioritize mode-specific instructions and prevent duplicates #3553
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.
Related GitHub Issue
Closes: 3152
Description
The Roo Code prompt UI shows the correct output.
In the "real" API POST "Global Instructions" always adds "Mode-specific Instructions":
...
\n\nGlobal Instructions:\nstart text "Custom Instructions for All Modes" text end\n\nYou can analyze code, explain concepts, and access external resources. Make sure to answer the user's questions and don't rush to switch to implementing code. Include Mermaid diagrams if they help make your response clearer.\n\nMode-specific Instructions:\nYou can analyze code, explain concepts, and access external resources. Make sure to answer the user's questions and don't rush to switch to implementing code. Include Mermaid diagrams if they help make your response clearer."
with the changes:
// Only add global instructions if they differ from mode-specific instructions
Test Procedure
Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Documentation Updates
Additional Notes
Postman API Post test with the fix:
Important
Enhance
addCustomInstructionsto prioritize mode-specific instructions and prevent duplicate global instructions, with comprehensive tests added.addCustomInstructionsincustom-instructions.tsnow prioritizes mode-specific instructions over global ones.custom-instructions.test.tsto verify prioritization of mode-specific instructions and prevention of duplicate global instructions.build-testing-version-vsix.shscript for packaging test versions of the extension.This description was created by
for 9686762. You can customize this summary. It will automatically update as commits are pushed.