Commit Graph

143 Commits

Author SHA1 Message Date
Li Liu 43c395a6d5 feat: improve debate format with named reviewers and adversarial prompts
- Replace anonymous [AI Reviewer] with specific reviewer IDs (e.g., [claude], [gemini])
- Rewrite prompts to emphasize adversarial debate, not collaborative review
- Each AI now knows: "You are [X], your opponent is [Y]"
- Use action words like "Challenge their points", "Defend your position"
- Remove verbose old instructions, keep prompts focused

This makes AIs actually argue with each other instead of politely agreeing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:30:29 +08:00
Li Liu 96fc85c217 fix: disable gemini-cli session support (uses full context mode)
Gemini CLI only supports index-based sessions (-r latest or -r 5),
not custom session IDs like Claude CLI. Since "latest" could refer
to a different session if user runs other Gemini commands, this is
unreliable. Disabled session support for Gemini CLI - it will always
use full context mode instead.

Also updated README to clarify session support per provider.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:10:33 +08:00
Li Liu de26a36e38 fix: gemini-cli session support for incremental discussion
Fixed bug where sessionId was checked instead of hasSession.
Now gemini-cli properly uses -r latest to resume sessions
for incremental discussion like claude-code.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 17:45:45 +08:00
Li Liu 9bcaf728fd docs: update README with new features
- Add gemini-cli to supported providers
- Document session persistence
- Document post-analysis Q&A feature
- Document markdown rendering
- Document cold jokes
- Update example config for CLI-only setup
- Add PR URL support in examples

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 17:43:33 +08:00
Li Liu fdc1eeca7a feat: add Gemini CLI provider support
- New gemini-cli provider using the Gemini CLI tool
- Uses -y (yolo mode) for auto-approve and -o text for clean output
- Supports session resumption with -r latest
- 15 minute timeout like other CLI providers
- Added to init wizard as a no-API-key option

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 17:36:43 +08:00
Li Liu 4fdb41d9ea fix: render markdown for analyzer and reviewer outputs
Previously only the final conclusion was rendered with markdown.
Now all reviewer outputs are buffered and rendered with marked
when each reviewer finishes speaking.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 17:32:08 +08:00
Li Liu 6de693bc0e feat: add session persistence and post-analysis Q&A
Session persistence (reduces token usage):
- Claude Code provider maintains session across rounds
- Uses --session-id for first call, --resume for subsequent
- Only sends incremental messages in session mode

Post-analysis interactive Q&A:
- In interactive mode (-i), user can ask specific reviewers before debate
- Format: @reviewer_id question (e.g., @claude What about security?)
- Allows clarifying questions before full debate begins

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 17:14:16 +08:00
Li Liu 68f31138c7 fix: stop spinner after summarizer completes
The summarizer uses non-streaming chat(), so onMessage callback
never fires to stop the spinner. Now explicitly stop it after
runStreaming() returns.

Also refactored spinner/interval to use object ref to fix
TypeScript control flow analysis issues with closures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:57:24 +08:00
Li Liu e7548ddd67 feat: render markdown in terminal for better readability
- Use marked + marked-terminal to render final conclusion
- Proper colors, bold, table alignment in terminal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:54:36 +08:00
Li Liu dd6466ade6 Revert "feat: improve summarizer output format for better readability"
This reverts commit 77a6ccda74.
2026-01-26 16:53:28 +08:00
Li Liu 77a6ccda74 feat: improve summarizer output format for better readability
- Structured format with clear sections (共识点, 分歧点, 行动项, 总体评估)
- Priority table for action items (P0/P1/P2)
- Detailed issue format with location, problem, risk, consensus level
- Clear merge status and conditions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:51:58 +08:00
Li Liu a153c0efa2 feat: increase timeout to 15min and show cold jokes while waiting
- Increase CLI provider timeout from 5 to 15 minutes for large PRs
- Display random programmer jokes while waiting for AI reviewers
- 36 English cold jokes rotate every 8 seconds

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:37:39 +08:00
Li Liu 0ba997e91a Merge pull request #1 from xiaofan-luan/feat/interactive-init-and-local-review
feat: add interactive reviewer selection and local diff review
2026-01-26 16:30:30 +08:00
xiaofanluan 30879d9742 feat: add interactive reviewer selection and local diff review
Add interactive mode to `magpie init` allowing users to select which AI
reviewers to configure. Shows available options with API key requirements
and generates a customized config. Supports -y flag for defaults.

Add --local flag to `magpie review` to review uncommitted changes (staged
+ unstaged) without needing a PR. Falls back to last commit if no local
changes exist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:27:44 +08:00
Li Liu 5d125a4c07 feat: support full PR URL and auto-detect repo from git remote 2026-01-26 16:20:11 +08:00
Li Liu 65d11bc39b feat: add 5-minute timeout for CLI providers to prevent hanging 2026-01-26 16:16:41 +08:00
Li Liu 5d2e9328a1 fix: don't force specific commands, let AI decide how to fetch details 2026-01-26 16:03:01 +08:00
Li Liu 0f4b596379 fix: pass task prompt to reviewers so they can access PR details 2026-01-26 16:01:50 +08:00
Li Liu ecf4667b1d refactor: let AI fetch diff itself instead of passing it 2026-01-26 15:56:40 +08:00
Li Liu 03dc45d195 fix: avoid repeating diff in every round, use analysis instead 2026-01-26 15:54:57 +08:00
Li Liu fcb3f17891 feat: add local review modes (--local, --branch, --files) 2026-01-26 15:35:37 +08:00
Li Liu a2f35e007d feat: improve output readability with better formatting 2026-01-26 15:30:04 +08:00
Li Liu 2afb5b756c docs: translate README to English 2026-01-26 15:21:34 +08:00
Li Liu ccba115f5e feat: add convergence detection, token tracking, and UX improvements
- Add convergence detection (default enabled, configurable)
- Add token usage estimation and cost tracking
- Add spinner for waiting states
- Fix AI sycophancy by clarifying debate context
- Explicitly state reviewer count in prompts
- Update README with Chinese documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:20:14 +08:00
Li Liu dd20e52451 feat: add OpenAI Codex CLI provider
Add codex-cli provider that calls the codex CLI command, similar to claude-code provider.
Also update gemini model to gemini-3-pro in user config.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:39:23 +08:00
Li Liu 76e7d32587 feat: add Gemini provider and update default config
Add Google Gemini provider using @google/generative-ai SDK with support
for both standard and streaming chat methods. Update default config
template to use simpler model-based reviewer names (claude, gemini)
instead of role-based names. Analyzer and summarizer now use claude-code.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:22:33 +08:00
Li Liu f87ecd31ed feat: add Claude Code CLI provider for subscription users 2026-01-26 13:13:15 +08:00
Li Liu 933a2d597e feat: add PR analyzer step before debate 2026-01-26 13:08:57 +08:00
Li Liu f566f8026d docs: add README 2026-01-26 12:38:58 +08:00
Li Liu b23f9cadb1 test: add E2E tests for CLI
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:38:16 +08:00
Li Liu 9c1d5b7838 feat: add streaming output support
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:36:55 +08:00
Li Liu 452ae2c8ec chore: add barrel exports
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:35:45 +08:00
Li Liu 1aaa4f73d9 feat: add CLI with review and init commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:34:32 +08:00
Li Liu 3f038cef4d feat: add debate orchestrator with round management
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:32:11 +08:00
Li Liu c2deace17f feat: add orchestrator type definitions 2026-01-26 12:30:13 +08:00
Li Liu 6a068dbbc4 feat: add provider factory for model routing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:29:08 +08:00
Li Liu 5d482f95a0 feat: add OpenAI provider with streaming
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:27:26 +08:00
Li Liu c69c394fba feat: add Anthropic provider with streaming
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:25:49 +08:00
Li Liu b7117ec8e6 feat: add AI provider type definitions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:24:12 +08:00
Li Liu bc1a999a98 feat: add config init with default template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:22:11 +08:00
Li Liu d16a439367 feat: add config loader with env var expansion
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:20:04 +08:00
Li Liu ce22bccba9 feat: add config type definitions
Add TypeScript interfaces for the Magpie configuration system:
- ProviderConfig: API key storage for providers
- ReviewerConfig: Model and prompt configuration
- DefaultsConfig: Default settings (max_rounds, output_format)
- MagpieConfig: Root configuration structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:17:59 +08:00
Li Liu db8651dfe0 chore: initialize project structure
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:12:42 +08:00