12 Commits

Author SHA1 Message Date
tgrosinger 2163ea45d2 OpenCode: Add OpenCode as a new provider
The OpenCode provider allows using a variety of models with an agent
harness that can gather more information from the codebase as required
(like with claude-code, codex, or gemini-cli).

This is an alternative to using OpenRouter directly, where the api
provider is more like a chatbot and cannot gather any additional context
beyond what was handed to it.
2026-05-29 16:19:13 -07:00
tgrosinger a8578beacd OpenRouter: Add OpenRouter as a new provider 2026-05-28 10:22:51 -07:00
Li Liu 5df0e65e5e feat: pre-flight check for CLI binaries with friendly error messages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 13:55:12 +08:00
ChrisPan bf896593b3 feat: add custom API base URL support for all API providers (#6)
Allow users to configure `base_url` per provider to connect to
compatible third-party endpoints (Azure OpenAI, Ollama, vLLM, one-api,
etc.). All four API providers (Anthropic, OpenAI, Gemini, MiniMax) now
accept an optional `base_url` in config which is passed through to
their respective SDKs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-26 22:55:17 +08:00
Li Liu 2b0e1ba711 refactor: comprehensive codebase improvements across 7 phases
Phase A - Quick fixes:
- Remove debug logging that leaked prompt content (qwen-code)
- Fix orchestrator session leak with try/finally cleanup
- CJK-aware token estimation for better accuracy
- Issue parser validation (line > 0, endLine >= line, non-empty fields)
- Improved similarity matching with stop words filtering and description weight

Phase B - Medium fixes:
- Add retry utility with exponential backoff for API providers
- Config validation at load time (required fields, empty API key warnings)
- GitHub PR comment deduplication (skip already-posted comments)
- Ctrl+C graceful exit for interactive comment review

Phase C - Structured logging:
- Logger class with debug/info/warn/error levels (MAGPIE_LOG_LEVEL env var)

Phase D - Type safety:
- Replace `any` types with proper types across discuss.ts, review.ts,
  issue-parser.ts, commenter.ts, repo-orchestrator.ts, history-collector.ts

Phase E - Session helper extraction:
- CliSessionHelper class shared by 4 CLI providers, reducing duplication

Phase F - Split review.ts (1991 → 6 files):
- review.ts (command + action), interactive.ts, repo-review.ts,
  session-cmds.ts, utils.ts, types.ts

Phase G - Tests:
- 6 new test files (retry, logger, session-helper, issue-parser-enhanced,
  loader-validation, orchestrator-session)
- Fix pre-existing test failures (commenter, anthropic)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 22:46:46 +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 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