Skip to content

feat: add review-loop command for autonomous PR review cycles#1569

Open
potb wants to merge 10 commits intocode-yeongyu:devfrom
potb:review-loop
Open

feat: add review-loop command for autonomous PR review cycles#1569
potb wants to merge 10 commits intocode-yeongyu:devfrom
potb:review-loop

Conversation

@potb
Copy link
Contributor

@potb potb commented Feb 6, 2026

Summary

Adds a new /review-loop builtin command that runs autonomous PR review cycles with parallel review agents, automatic issue verification, and auto-fix capabilities.

Implementation

  • Hook System: New review-loop hook following ralph-loop patterns
  • State Persistence: Frontmatter YAML with target_branch and pr_files for scope enforcement
  • Parallel Review: 4 agents review simultaneously, findings aggregated
  • Smart Verification: Critical/high issues and non-consensus findings double-checked
  • Auto-Fix Loop: Fixes confirmed issues, commits, pushes, re-reviews until clean
  • Max Iterations: Default 10 iterations with safety stop

Files Changed

Created (6 files, ~1410 lines):

  • src/hooks/review-loop/ - Hook implementation with types, constants, storage, tests
  • src/features/builtin-commands/templates/review-loop.ts - 9-step review loop template

Modified (5 files):

  • Config schema, command registration, hook integration

Testing

  • ✅ 28 new tests (13 storage + 15 hook)
  • ✅ 76 expect() calls
  • ✅ All tests pass (2177/2187, 10 pre-existing flaky)
  • ✅ Zero regressions
  • ✅ Typecheck clean
  • ✅ Build succeeds

Verification

bun test src/hooks/review-loop/  # 28/28 pass
bun run typecheck                 # exit 0
bun run build                     # exit 0

Usage

/review-loop main  # Review current branch against main
/stop-continuation # Cancel active review loop

Commits

  1. feat(review-loop): add types and constants
  2. feat(review-loop): add storage layer with tests
  3. feat(review-loop): add command template
  4. feat(review-loop): add config schema and command registration
  5. feat(review-loop): implement review-loop hook with tests
  6. feat(review-loop): integrate hook in plugin lifecycle

Summary by cubic

Adds a new /review-loop command and hook to run autonomous PR review cycles with parallel reviewers and automatic continuation until no CRITICAL/HIGH issues remain. Merges the latest dev branch and restores a lost managers initialization.

  • New Features

    • Built-in /review-loop with template and [target-branch] arg; loops until clean or max 10 iterations.
    • review_loop config (enabled, default_max_iterations, state_dir); state saved to .sisyphus/review-loop.local.md.
    • Hook export and continuation prompt include target branch and PR files; completion detected via transcript or session messages.
  • Bug Fixes

    • Restored createManagers call in plugin init after a merge conflict to ensure managers are properly set up.

Written for commit 939f63c. Summary will update on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

marlon-costa-dc pushed a commit to marlon-costa-dc/oh-my-opencode that referenced this pull request Feb 9, 2026
…ous PR review cycles

**Source**: code-yeongyu#1569
**Author**: @potb (Peïo Thibault)
**Branch**: origin/review-loop → dev

## Feature Overview

Adds `/review-loop` command that continuously reviews code until no CRITICAL or HIGH issues remain (max 10 iterations). Autonomous quality improvement workflow.

## Modular Architecture Adaptation

This merge adapts the review-loop feature to upstream's modular schema architecture (commit 3d5abb9):

### Files Added (Modular Pattern)
- `src/config/schema/review-loop.ts` - Extracted from inline schema
  - `ReviewLoopConfigSchema`: enabled, default_max_iterations, state_dir
  - Follows upstream pattern: isolated feature schema with barrel export
- `src/hooks/review-loop/` - Hook implementation (index.ts, storage.ts, constants.ts, types.ts, tests)
- `src/features/builtin-commands/templates/review-loop.ts` - Command template

### Files Modified
- `src/config/schema.ts`
  - Added: `export * from "./schema/review-loop"` (barrel export)
  - Integration point for modular schema system
- `src/features/builtin-commands/commands.ts`
  - Added: `REVIEW_LOOP_TEMPLATE` import and command definition
- `src/features/builtin-commands/types.ts`
  - Added: `"review-loop"` to `BuiltinCommandName` union
- `src/hooks/index.ts`
  - Added: `createReviewLoopHook` export
- `src/index.ts`
  - Added: Review-loop hook registration with conditional enablement
  - Added: Loop trigger detection in chat.message handler
  - Added: Command detection in PreToolUse handler

## Patch Hierarchy

This feature is **self-contained** and has NO dependencies on other feature PRs.

**Dependencies**: None (standalone feature)
**Required by**: None (other features don't depend on this)

## Verification

```bash
bun run typecheck  # ✅ MUST pass with 0 errors
bun run build      # ✅ MUST succeed
```

**Tested**: Each modification maintains modular architecture compliance.
potb added 3 commits February 10, 2026 17:37
# Conflicts:
#	src/config/schema.ts
#	src/features/builtin-commands/commands.ts
#	src/features/builtin-commands/types.ts
#	src/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant