feat: add ralph-loop for autonomous task completion#9312
Open
ktsaou wants to merge 1 commit intoanomalyco:devfrom
Open
feat: add ralph-loop for autonomous task completion#9312ktsaou wants to merge 1 commit intoanomalyco:devfrom
ktsaou wants to merge 1 commit intoanomalyco:devfrom
Conversation
Add a plugin-based mechanism to repeatedly inject prompts into sessions, allowing autonomous task completion without human intervention. - Add `chat.waiting` hook triggered when assistant finishes - Register ralph-loop as internal plugin with state management - Support `/ralph-loop` and `/ralph-loop:cancel` slash commands - Add command palette entries for start/cancel - Include completion promise detection with `<promise>` tags - Enforce safety limits (default 20, max 100 iterations) - Add 40 unit and integration tests
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
1 task
|
Hey! If I’m understanding this correctly, this solution doesn’t really match the original idea behind Ralph Loop. As far as I can tell, in this implementation each loop step doesn’t get a fresh/clean context window, and that’s pretty critical for this approach. Could you take a look at this breakdown? I might be misunderstanding something, so happy to be corrected |
8 tasks
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
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.
Closes #9199
Summary
Add Ralph Loop - a plugin-based mechanism that enables OpenCode to autonomously continue working on tasks without requiring human input after the initial prompt.
This feature is inspired by Ralph and allows the model to iterate on tasks until a completion condition is met or safety limits are reached.
How it works
/ralph-loop "your task" -p "COMPLETION_TEXT"chat.waitinghook fires<promise>COMPLETION_TEXT</promise>, the loop stopsUsage
Features
<promise>TEXT</promise>tags/ralph-loop:cancelor command paletteTest plan