Conversation
|
@claude[agent] resolve the conflicts. Check if the original problem still exists, and if it does, adapt your optimization to the current code. |
…iewers method - Created _execute_reviewers() helper method to centralize reviewer execution logic - Replaced duplicated reviewer loops in _revise_task_pipeline and _execute_task - Reduces 40+ lines of code duplication - Improves maintainability: reviewer logic changes now only need one edit - All tests pass (70 agent tests + 13 arbitration tests) Agent-Logs-Url: https://github.com/zclllyybb/multi-agent-todo/sessions/544a1622-1651-4d0d-b059-a507ad55e669 Co-authored-by: zclllyybb <61408379+zclllyybb@users.noreply.github.com>
99e9e9e to
e0e561d
Compare
Conflicts resolved in commit e0e561d. ✅ Original Problem Status: RESOLVED The branch has been rebased onto master (b5b8532). The duplicated reviewer loop code that existed in 3 locations has been successfully reduced to 1 reusable What was fixed:
Verification:
|
There was a problem hiding this comment.
Pull request overview
Refactors the Orchestrator’s multi-reviewer execution logic to reduce duplication across task pipelines while preserving the existing “short-circuit on first rejection” behavior for develop/revise flows.
Changes:
- Introduces a shared
_execute_reviewers()helper that runs configured reviewers and aggregates results/output. - Updates
_execute_task()and_revise_task_pipeline()to use_execute_reviewers()instead of inlined reviewer loops. - Minor edits in
_review_only_pipeline()around reviewer-loop setup/comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| rejection_outputs = [] | ||
| all_passed = True |
There was a problem hiding this comment.
In _review_only_pipeline, the new rejection_outputs list is never used, and the initial all_passed = True is immediately overwritten later by all(...). Removing these unused/duplicative variables (or wiring them into the output construction) will reduce confusion and keep this block consistent with the rest of the reviewer pipelines.
| rejection_outputs = [] | |
| all_passed = True |
| review_method: str, | ||
| short_circuit: bool = True, | ||
| **review_kwargs, | ||
| ) -> tuple[list[dict], bool, list[str]]: | ||
| """ | ||
| Execute all reviewers and return results. | ||
|
|
||
| Args: | ||
| task: Task being reviewed | ||
| worktree_path: Path to the worktree | ||
| review_method: Name of the review method to call ('review_changes' or 'review_patch') | ||
| short_circuit: If True, stop after first rejection; if False, run all reviewers | ||
| **review_kwargs: Additional kwargs to pass to the review method | ||
|
|
||
| Returns: | ||
| Tuple of (reviewer_results, all_passed, rejection_outputs) | ||
| """ | ||
| reviewer_results = [] | ||
| rejection_outputs = [] | ||
| all_passed = True | ||
|
|
||
| for reviewer in self.reviewers: | ||
| # Call the appropriate review method | ||
| review_fn = getattr(reviewer, review_method) | ||
| review_run, passed, review_text = review_fn( |
There was a problem hiding this comment.
_execute_reviewers relies on a string review_method and getattr(reviewer, review_method); if a wrong method name is ever passed, the failure will be an AttributeError (or a confusing MagicMock call in tests). Consider validating review_method against an allow-list (e.g., review_changes/review_patch) and raising a clear ValueError when invalid, and/or accepting a callable instead of a string.
| def _execute_reviewers( | ||
| self, | ||
| task: Task, | ||
| worktree_path: str, | ||
| review_method: str, | ||
| short_circuit: bool = True, | ||
| **review_kwargs, | ||
| ) -> tuple[list[dict], bool, list[str]]: |
There was a problem hiding this comment.
The new _execute_reviewers helper now contains the core reviewer-loop logic (including short-circuiting behavior). There doesn't appear to be a unit test asserting the short-circuit behavior and correct aggregation of rejection_outputs across multiple reviewers, so a small test would help prevent regressions when this helper is reused/extended.
No description provided.