After discuss generates a comment, users can now press [r] to
regenerate with custom instructions (e.g. "more concise", "add code
example"). Supports unlimited regeneration cycles with full
conversation context preserved.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrote commenter to post each issue as an individual inline comment
on the specific line via GitHub PR comments API. If the line is not
in the diff, falls back to a regular PR comment with file:line context.
Previously used batch PR review API where one invalid line would fail
the entire batch.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Discussion mode ('d') now auto-sends first message asking the
reviewer to explain the issue in detail (where, why, how to fix)
before user interaction begins
- Progress bar shows running tally: posted/edited/discussed/skipped
counts displayed on each issue header
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: ora's default discardStdin=true calls process.stdin.pause()
when spinner stops. This makes the stdin handle inactive in libuv, and
since readline's question() does not call resume(), the event loop sees
no active handles and the process exits silently. Only affects TTY
environments (stdinDiscarder checks isTTY).
Fix: use discardStdin:false on all ora spinners that coexist with
readline, plus explicit process.stdin.resume() safety net.
Also includes:
- Multi-turn discussion with conversation history and debate context
- AI-generated final comments after discussion
- unhandledRejection guard for async generator cleanup
- Pre-fetch PR diff so API-only models get the code
- Solo review/discuss support (min 1 reviewer, skip convergence)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- AnthropicProvider: stream.abort() in finally block ensures HTTP
connection is released even if consumer breaks early
- OpenAIProvider: stream.controller.abort() for same reason
- GeminiProvider: document that consuming all chunks is sufficient
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- MockProvider for debug mode: supports MAGPIE_MOCK_DELAY,
MAGPIE_MOCK_RESPONSE, MAGPIE_MOCK_FILE env vars; echoes input by default
- QwenCodeProvider: wraps qwen-code CLI (OAuth-based)
- MiniMaxProvider: API-based provider using MiniMax-M2.5
- config.mock top-level flag: when true, all models route to MockProvider
- model prefix matching: mock, mock1, mock2 etc. all map to mock provider
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use `codex exec --json` and `codex exec resume <thread_id>` to maintain
multi-turn conversation state, matching Claude and Gemini CLI behavior.
In debate rounds, only the last message is sent instead of full history.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Structurizer now requests comprehensive markdown descriptions with
original code quotes, impact analysis, and fix rationale — suitable
for GitHub PR comments.
2. Fix discuss (d) silently skipping: raisedBy was stripped by
parseReviewerOutput, defaulting to ['summarizer'] which matched no
reviewer. Now preserved through parsing pipeline, with fallback to
first available reviewer.
3. Issue display now renders markdown via marked() for proper formatting.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When extracting structured issues from review text, Claude Code with
--dangerously-skip-permissions would interpret file paths and fix suggestions
as instructions to modify code, producing "All fixes applied..." instead of
JSON. Fix by passing --tools "" to disable all tools for the structurizer call.
Also: end summarizer session before structurization for clean non-session call,
make issue-parser more lenient (accept raw JSON objects, optional verdict/summary).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The analysis content was still buffered when onContextGathered fired,
causing the context section to appear before the analysis text.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reviewer output format is not under our control. Instead of trying to
parse JSON blocks from reviewer messages (which may not match our schema),
always use the summarizer to extract structured issues from the review
discussion text. This is more robust and removes any dependency on
reviewer prompt configuration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When reviewers don't include structured JSON blocks in their output,
the summarizer is called to extract issues from the unstructured review
text into the standard JSON format. This ensures the per-issue
interactive post-processing flow always works for PR reviews.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Session names now include explicit role: "reviewer:gemini" instead of
just "gemini", matching analyzer/summarizer pattern
2. PR post-processing no longer requires structured JSON issues. When
reviewers don't output JSON blocks, offers to post the final
conclusion as a general PR comment instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move onContextGathered callback to after Promise.all resolves, so context
displays after analysis finishes streaming. Work is still parallel, only
the display is sequential.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents AI from outputting chatty preamble like "Here's my analysis"
before the actual content.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Gemini CLI: full session persistence via -o json/stream-json and
--resume <uuid>, NDJSON parsing for streaming session_id capture
- Claude Code & Gemini CLI: session naming via [name] prefix in first
message, visible in gemini --list-sessions and claude --resume
- Provider interface: startSession() now accepts optional name parameter
- Codex CLI: include stderr in error messages for better diagnostics
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Validates that PR numbers are numeric-only in postPRReview and
getPRHeadSha before passing them to shell commands.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add human-in-the-loop review for each issue before posting to GitHub.
After structured issues are displayed, users can review each issue and
choose to post as-is, edit, discuss with the original reviewer, skip,
or stop. Approved comments are batched and posted via the GitHub API.
- Add getReviewers() method to DebateOrchestrator
- Add interactiveCommentReview function with per-issue actions (p/e/d/s/q)
- Add discuss mode: back-and-forth with the AI reviewer who raised the issue
- Wire post-processing prompt into PR review flow after issue table display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add commenter module that builds GitHub PR review payloads from merged
issues. Issues with file+line become inline review comments, issues
without line info go into the review body. Includes gh CLI wrappers for
posting reviews and fetching PR head SHA.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add formatCallChainForReviewer to display exact code snippets at each
call site, giving reviewers precise context about how changed symbols
are used across the codebase. Raw references are now stored in
GatheredContext and formatted into the reviewer prompt.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add parseFocusAreas to extract suggested review focus from analyzer
output and inject them as hints into each reviewer's first-round
prompt. Focus areas are suggestions, not constraints — reviewers are
explicitly told to also flag anything else they notice.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add parseReviewerOutput to extract structured issues from reviewer
JSON blocks and deduplicateIssues to merge similar issues across
multiple reviewers using Jaccard similarity on title words.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add reference collector module that:
- Extracts function/class symbols from git diffs
- Uses ripgrep to find where symbols are referenced in the codebase
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add onConvergenceJudgment callback to display why judge ruled converged/not
- Increase joke rotation interval from 8s to 15s
- Fix markdown rendering issues from LLMs like Codex:
- Add fixMarkdown() to convert indented lists to standard format
- Increase terminal width from 80 to 120
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous convergence check had two issues:
1. It could declare convergence after round 1, when reviewers hadn't
seen each other's opinions yet (independent reviews)
2. The parsing logic was too loose - any response containing "CONVERGED"
would pass, even if it was part of a sentence
Changes:
- Require at least 2 completed rounds before checking convergence
- Add stricter consensus criteria (critical issues must be cross-validated)
- Fix parsing to only accept exact "CONVERGED" as first word
- Clarify that silence on another's point is NOT agreement
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix readline stdin state issue causing immediate exit in -i mode
- Fix analysis content not displaying before interactive prompt
- Add follow-up Q&A after Final Conclusion in review command
- Refactor selectReviewers to accept optional shared readline instance
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>