feat(tui): add 4R review agents to model picker#936
Conversation
- Add RRPhases() function with 4 review agents (risk, readability, reliability, resilience) - Add RRSeparatorRowIdx() for 4R separator row navigation - Update ModelPickerRows() to include 4R section after JD agents - Update applyAssignment() and applyAssignmentPreservingMatchingEffort() to handle 4R rows - Update renderPhaseList() to render 4R separator and agent rows - Update title to mention 4R reviewers - Update ModelPickerRowsForProfile() comment to clarify 4R exclusion - Update ConfigurableAgentPhases() to include 4R agents - Update TestModelPickerRows_Count (16 → 21 rows) - Add 5 new tests for 4R navigation and assignment - Update ConfigurableAgentPhases() comment to mention 4R reviewers Closes Gentleman-Programming#928
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
Changes4R Review Agent Model Picker Support
Sequence DiagramsequenceDiagram
participant User
participant ModelPicker as Model Picker UI
participant RowMapper as Row Index Mapper
participant AssignmentEngine as Assignment Engine
participant Renderer as Renderer
User->>ModelPicker: Select 4R agent row
ModelPicker->>RowMapper: SelectedPhaseIdx (RR range)
RowMapper->>RowMapper: Compute RRSeparatorIdx
RowMapper->>RowMapper: Map row to RRPhases() entry
RowMapper->>AssignmentEngine: Selected RR phase + provider/model
AssignmentEngine->>AssignmentEngine: Apply assignment (no-op if separator)
AssignmentEngine->>Renderer: Update assignments map
Renderer->>Renderer: Compute rrSeparatorIdx
Renderer->>Renderer: Render 4R separator divider
Renderer->>Renderer: Render RR agent row with label
Renderer->>User: Display updated picker with assignment
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/tui/screens/model_picker_test.go`:
- Around line 1391-1401: The test TestModelPickerRowsForProfile_NoRRAgents
currently only verifies that individual RR agents from opencode.RRPhases() are
excluded from the rows returned by ModelPickerRowsForProfile(), but it does not
verify that the "--- 4R Review ---" separator row itself is excluded. Add an
additional assertion after the nested loop to explicitly check that the RR
separator string is not present in the returned rows, ensuring a UI regression
where only the separator appears would be caught by the test.
In `@internal/tui/screens/model_picker.go`:
- Around line 166-177: The RRSeparatorRowIdx function unconditionally adds 1 for
the JD separator in its row index calculation, but the ModelPickerRows function
only conditionally adds the JD separator when len(opencode.JDPhases()) is
greater than 0. To maintain consistency and prevent potential off-by-one errors,
modify the RRSeparatorRowIdx function to add the same conditional check: only
include the +1 for the JD separator in the return statement when
len(opencode.JDPhases()) > 0, matching the logic used in ModelPickerRows.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 62767fdc-bd7a-4ba2-a7de-12ea3b9b0f31
📒 Files selected for processing (3)
internal/opencode/models.gointernal/tui/screens/model_picker.gointernal/tui/screens/model_picker_test.go
- Add defensive check in RRSeparatorRowIdx() to match ModelPickerRows() logic - Add test assertion to verify 4R separator is excluded from profile rows Addresses CodeRabbit review comments on PR Gentleman-Programming#936
|
Applied CodeRabbit review feedback:
All tests pass. |
Summary
Adds 4R review agents (risk, readability, reliability, resilience) to the TUI model picker, allowing users to configure independent models for each reviewer.
Changes
Core Implementation
enderPhaseList() to render 4R separator and agent rows
Tests
Row Layout
\
Row 0: gentle-orchestrator (coordinator)
Row 1: Set all SDD phases
Rows 2-11: SDD phases (10)
Row 12: --- Judgment Day ---
Rows 13-15: JD agents (3)
Row 16: --- 4R Review ---
Rows 17-20: 4R agents (4)
\\
Notes
Closes #928
Summary by CodeRabbit