fix(coding-agent): make subagent deletion user-requested in the system prompt - #1952
Merged
Merged
Conversation
hallerite
approved these changes
Sep 1, 2026
sethkarten
reviewed
Sep 1, 2026
sethkarten
left a comment
Contributor
There was a problem hiding this comment.
Not approved. This will lead to substantial subagent build up and kill RAM
snimu
pushed a commit
that referenced
this pull request
Sep 1, 2026
* revert(coding-agent): restore subagent cleanup guidance Reverts #1952 so agents delete direct subagents when they are no longer needed instead of retaining them until a user explicitly requests deletion. Adds prompt coverage for the intended cleanup policy. * test(coding-agent): keep prompt rollback free of copy assertions
paralin
pushed a commit
to paralin/prime-agent
that referenced
this pull request
Sep 2, 2026
paralin
pushed a commit
to paralin/prime-agent
that referenced
this pull request
Sep 2, 2026
…ct-ai#1955) * revert(coding-agent): restore subagent cleanup guidance Reverts PrimeIntellect-ai#1952 so agents delete direct subagents when they are no longer needed instead of retaining them until a user explicitly requests deletion. Adds prompt coverage for the intended cleanup policy. * test(coding-agent): keep prompt rollback free of copy assertions
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.
The delegation section of the system prompt instructs the model to "Delete a direct child explicitly with
await rlm.delete_subagent(child)when it is no longer needed." Models follow it: finished subagents get deleted routinely, destroying their sessions and any warm context that would make them cheap to reuse for follow-up work. Idle children cost little to keep.The sentence now reads: "You can delete a direct child explicitly with
await rlm.delete_subagent(child). Only do this if and when a user asks for it." The capability stays documented; the default behavior flips from delete-when-done to keep-unless-asked.Prompt-content tests still pass unchanged (they pin the call form, not the old sentence).
Linear: ENG-5836
Note
Restrict subagent deletion to user-requested only in
buildRlmPromptUpdates the delegation guidance in the RLM system prompt so that explicit deletion of a direct child subagent occurs only when the user asks for it. Previously the prompt directed deletion when the child was no longer needed. Idle children now remain available for follow-ups.
Macroscope summarized 5523618.