Move RLM system prompt into first user prompt#764
Merged
Conversation
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.
Description
The RLM contains a system prompt that describes the scaffolding, as well as dynamic information such as the tools available to the sub-LLMs, the tools available to the RLM inside the REPL, and in Python mode, the installed packages. This is crucial information, but so is the normal system prompt which describes the tool parser among other important facts. Therefore, the RLM system prompt should neither overwrite the user-set system prompt, nor be overwritten by it. Previously, it was however overwritten by the user-set system prompt.
This PR changes that by changing the user prompt like this:
<RLM_SCAFFOLDING> {rlm_system_prompt} <RLM_SCAFFOLDING> {user_prompt}This preserves any user-provided system prompt, but still properly separates the rlm-scaffolding information from the actual user prompt.
Type of Change
Testing
uv run pytestlocally.Checklist
Note
Behavior change
RLMEnv.get_prompt_messages: On first turn, prepends the RLM scaffolding (filesystem summary, REPL workflow, tool docs) to the firstusermessage, wrapped in<RLM_SCAFFOLDING>...</RLM_SCAFFOLDING>, instead of modifying thesystemmessage.contentasstr/list-of-parts/dict; falls back to adding a newusermessage if needed.Docs
docs/environments.mdandenvironments/AGENTS.mdto describe the new scaffolding injection into the first user message and clarify RLM prompts/tooling behavior.Written by Cursor Bugbot for commit accc98a. This will update automatically on new commits. Configure here.