feat: add autonomous coach-player mode for improved code quality (It's the Goose 3 CLI coding model)#11309
Open
chaollapark wants to merge 1 commit intoanomalyco:devfrom
Open
Conversation
Implements a coach-player adversarial feedback loop that improves code quality by having two agents with opposing objectives work together: - Player agent: implements requirements, writes code - Coach agent: reviews, critiques, finds gaps (fresh instance each turn) Key features: - Configurable max turns (default: 5) - Different models for player vs coach - Metrics tracking (tokens, duration per turn) - Clear approval signal detection - JSON output format for scripting Usage: opencode autonomous requirements.md opencode autonomous "Build a CLI" --max-turns 10 opencode autonomous req.md -p anthropic/claude-3-5-sonnet -c openai/gpt-4o Files added: - packages/opencode/src/autonomous/ (types, player, coach, index) - packages/opencode/src/cli/cmd/autonomous.ts - packages/opencode/test/autonomous/autonomous.test.ts
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: Potential Duplicate FoundPR #9312: feat: add ralph-loop for autonomous task completion Why it might be related: This PR also addresses autonomous task completion with an iterative loop mechanism. While it may use different implementation details ("ralph-loop" vs "coach-player mode"), both PRs appear to tackle similar autonomous execution patterns. Worth reviewing to ensure there's no overlapping functionality or conflicting approaches. |
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.
What does this PR do?
Adds an autonomous coach-player adversarial feedback loop to OpenCode CLI (
opencode autonomous) to improve implementation quality via iterative critique.Inspired by Block's Goose 3 "adversarial cooperation" approach:
https://block.xyz/documents/adversarial-cooperation-in-code-synthesis.pdf
Roles
Key features
--max-turnsconfigurable (default: 5)IMPLEMENTATION_APPROVED) for reliable stop condition--format jsonoutput for scripting/automationUsage
opencode autonomous requirements.md opencode autonomous "Build a CLI" --max-turns 10 opencode autonomous req.md -p anthropic/claude-3-5-sonnet -c openai/gpt-4oCode layout
packages/opencode/src/autonomous/*(types, player, coach, loop/index)packages/opencode/src/cli/cmd/autonomous.tspackages/opencode/test/autonomous/autonomous.test.tspackages/opencode/src/index.ts(command registration)How did you verify your code works?
Automated
packages/opencode/test/autonomous/autonomous.test.ts)Manual smoke tests
opencode autonomous requirements.mdcompletes successfully--max-turns 1stops after 1 turnIMPLEMENTATION_APPROVED) exits early--format jsonprints valid JSON and includes per-turn metricsNotes