feat(review): use GitHub Copilot CLI as reviewer#8
Merged
Conversation
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.
Motivation
Description
src/lib/copilot.tsimplementingcheckCopilotAvailable()andrunCopilotReview()that runcopilotin JSON output mode, parse JSONL defensively intoReviewComment[], normalise severity, dedupe comments, and surfaceCopilotNotFoundError/CopilotReviewErrorwith codes (not_found|review_failed|parse_failed).codex.applyDiff(sessionId)before review, runrunCopilotReview()against the service working tree, and always revert local changes withgit checkout .after the review; the arbiter still receives the sameReviewComment[]contract.src/commands/start.ts) so the CLI fails with a clear error ifcopilotis not present, and updatesrc/lib/review-loop.tsto userunCopilotReview()instead of the Claude reviewer.CopilotErrorCodetosrc/types/index.tsand add unit/integration tests (test/unit/copilot.test.ts, updates totest/unit/review-loop.test.tsandtests/integration/start.test.ts) to cover command execution, parsing, and integration points.Testing
npm testand all tests passed (unit and integration suites included Copilot mocks and exercise the new flow).npm run typecheckandnpm run lintand both completed successfully after minor lint fix, and the project built withnpm run buildwithout errors.copilotbinary during the run and observedcopilot: command not foundin this environment, so the tests mockcopilotbehavior to validate parsing and error handling.Codex Task