This guide helps you diagnose and fix common issues with Multi-Provider Code Review.
- Installation Issues
- API Key Problems
- Provider Failures
- Performance Issues
- GitHub Integration
- Self-Hosted Deployment
- Advanced Debugging
Symptoms:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
Solutions:
-
Update Node.js: Ensure you're running Node.js 20 or later
node --version # Should be v20.x or higher -
Clear npm cache:
npm cache clean --force rm -rf node_modules package-lock.json npm install
-
Use legacy peer deps:
npm install --legacy-peer-deps
Symptoms:
Error: Cannot find module 'tree-sitter'
gyp ERR! build error
Solutions:
-
Install build tools:
- macOS:
xcode-select --install - Ubuntu/Debian:
sudo apt-get install build-essential - Windows: Install Visual Studio Build Tools
- macOS:
-
Rebuild native modules:
npm rebuild tree-sitter
-
Use pre-built binaries: Tree-sitter modules are marked as
optionalDependencies, so the action will work without them (but with reduced functionality for some languages)
Symptoms:
Error: OPENROUTER_API_KEY is required
Error: API key for openrouter is required
Solutions:
-
Verify key is set in GitHub Secrets:
- Go to Repository Settings → Secrets and variables → Actions
- Ensure
OPENROUTER_API_KEYexists and is correct - Get a free key at openrouter.ai/keys
-
Check key format:
- OpenRouter keys start with
sk-or-v1- - Key should be ~64 characters long
- No extra spaces or newlines
- OpenRouter keys start with
-
Test key locally:
curl https://openrouter.ai/api/v1/models \ -H "Authorization: Bearer $OPENROUTER_API_KEY"
Symptoms:
Error: Rate limit exceeded
status: 'rate-limited'
Solutions:
-
Reduce parallel providers:
PROVIDER_MAX_PARALLEL: '2' # Default is 3
-
Enable incremental review:
INCREMENTAL_ENABLED: 'true' # Reduces API calls on updates
-
Use provider rotation:
PROVIDER_LIMIT: '3' # Use fewer providers per review
-
Add delays between retries:
PROVIDER_RETRIES: '1' # Reduce retries
Symptoms:
Providers used: 3 (success 0, failed 3)
Review completed with 0 findings
Diagnosis: Check the "Raw provider outputs" section in the PR comment for specific error messages.
Common Causes:
-
API keys not set:
- Verify all required API keys are in GitHub Secrets
- Check
.env.examplefor required keys
-
Network issues:
- Providers may be temporarily unavailable
- Check openrouter.ai/status
-
Invalid model names:
- Verify model names in
REVIEW_PROVIDERS - Check available models: openrouter.ai/docs#models
- Verify model names in
-
Budget exceeded:
- Check
BUDGET_MAX_USDsetting - Review may be skipped if estimated cost exceeds budget
- Check
Symptoms:
Provider openrouter/model: timeout (30.0s)
Solutions:
-
Increase timeout:
RUN_TIMEOUT_SECONDS: '900' # Default is 600 (10 min)
-
Reduce diff size:
DIFF_MAX_BYTES: '80000' # Default is 120000
-
Exclude large files:
EXCLUDE_PATTERNS: '**/*.lock,**/*.min.js,dist/**'
Symptoms:
Error: Model requires credits
Error: No free credits available
Solutions:
-
Use confirmed free models:
REVIEW_PROVIDERS: | openrouter/google/gemini-2.0-flash-exp:free, openrouter/mistralai/devstral-2512:free
-
Check model pricing:
- Visit openrouter.ai/models
- Look for models with "free" tag
- Free models may have rate limits
Diagnosis: Check review duration in PR comment:
Duration: 300.0s • Cost: $0.1234 • Tokens: 50000
Solutions:
-
Enable incremental review (fastest):
INCREMENTAL_ENABLED: 'true' # 6x faster on PR updates
-
Reduce provider count:
PROVIDER_LIMIT: '2' # Use fewer providers PROVIDER_MAX_PARALLEL: '2' # Reduce parallelism
-
Exclude unnecessary files:
EXCLUDE_PATTERNS: '**/*.test.ts,**/*.spec.ts,dist/**,node_modules/**'
-
Disable expensive features:
ENABLE_AST_ANALYSIS: 'false' # Skip AST analysis GRAPH_ENABLED: 'false' # Skip dependency graph
-
Use faster models:
- Prefer "flash" or "turbo" variants
- Example:
gemini-2.0-flash-exp:freeinstead of slower models
Symptoms:
Cost: $5.00 per review
Total monthly cost: $500+
Solutions:
-
Use free providers:
REVIEW_PROVIDERS: | openrouter/google/gemini-2.0-flash-exp:free, openrouter/mistralai/devstral-2512:free
-
Enable incremental review:
INCREMENTAL_ENABLED: 'true' # 80% cost reduction on updates
-
Set budget limit:
BUDGET_MAX_USD: '0.10' # Skip reviews exceeding $0.10
-
Enable caching:
ENABLE_CACHING: 'true' # Cache findings for reuse
-
Review fewer files:
MAX_CHANGED_FILES: '50' # Skip reviews with >50 files
Symptoms:
Error: JavaScript heap out of memory
FATAL ERROR: Reached heap limit
Solutions:
-
Reduce diff size:
DIFF_MAX_BYTES: '50000' # Smaller chunks
-
Exclude large files:
EXCLUDE_PATTERNS: '**/*.lock,**/*.svg,**/*.min.js'
-
Use smaller runner: (Self-hosted only)
runs-on: ubuntu-latest # Has more memory than smaller runners
-
Disable graph features:
GRAPH_ENABLED: 'false' # Reduces memory usage
Symptoms:
- Action completes successfully
- No comments appear on PR
- No errors in logs
Solutions:
-
Check permissions:
permissions: contents: read pull-requests: write # Required for commenting
-
Verify token scope:
GITHUB_TOKENshould be${{ secrets.GITHUB_TOKEN }}- Token needs
pull_requests: writepermission
-
Check PR state:
- PR must be open (not closed or merged)
- PR must not be a draft (unless configured to review drafts)
-
Check skip conditions:
- Review labels:
SKIP_LABELSsetting - Draft PRs:
SKIP_DRAFTSsetting - Min/max files:
MIN_CHANGED_LINES,MAX_CHANGED_FILES
- Review labels:
Symptoms:
- New comment on every push
- Old comments remain
Solutions:
-
Enable incremental review:
INCREMENTAL_ENABLED: 'true' # Updates existing comment
-
Check workflow trigger:
on: pull_request: types: [opened, synchronize] # Not ready_for_review
-
Use concurrency control:
concurrency: group: review-${{ github.event.pull_request.number }} cancel-in-progress: true
Symptoms:
⚠️ Skipping review for fork PR without OPENROUTER_API_KEY
Fork PRs cannot access repository secrets
Explanation: This is expected behavior for security. Fork PRs don't have access to repository secrets.
Solutions:
- Manual trigger: Use
workflow_dispatchto manually approve and run review - Use free providers without secrets: Not recommended for security reasons
- Use GitHub App: Create a GitHub App with proper permissions (advanced)
Symptoms:
Error: Cannot find module './dist/index.js'
Container exits immediately
Solutions:
-
Build dist files:
npm run build:prod
-
Verify dist directory:
ls -la dist/ # Should contain index.js and CLI files -
Check Docker logs:
docker logs mpr-review
-
Rebuild image:
docker-compose build --no-cache docker-compose up -d
Symptoms:
Webhook delivery failed: 401 Unauthorized
GitHub shows webhook delivery failure
Solutions:
-
Verify webhook secret:
- Generate secure secret:
openssl rand -hex 32 - Set in
.env:WEBHOOK_SECRET=your_generated_secret - Use same secret in GitHub webhook settings
- Generate secure secret:
-
Check signature header:
- GitHub sends
X-Hub-Signature-256header - Secret must match exactly (case-sensitive)
- GitHub sends
-
Test locally:
curl -X POST http://localhost:3000/health # Should return 200 OK
Symptoms:
Error: Rate limit exceeded for PR #123
Too many reviews per minute
Solutions:
-
Adjust rate limits:
WEBHOOK_RATE_LIMIT_PER_MINUTE=20 # Default: 10 WEBHOOK_RATE_LIMIT_PER_PR=10 # Default: 5
-
Check cleanup interval:
- Rate limits reset automatically
- Check logs for cleanup messages
-
Restart container:
docker-compose restart mpr-webhook
env:
LOG_LEVEL: 'debug' # debug, info, warn, error
VERBOSE: 'true'- Go to Actions tab in GitHub
- Click on failed workflow run
- Expand "Multi-Provider Code Review" step
- Look for error messages
Reports are saved as workflow artifacts:
- Go to workflow run
- Scroll to "Artifacts" section
- Download
multi-provider-review.jsonandmulti-provider-review.sarif
# Clone repo
git clone <your-repo>
cd <your-repo>
# Install CLI
npm install -g multi-provider-code-review
# Review locally
mpr review
# Check cache
ls -la .mpr-cache/
# View analytics
mpr analytics summary# Test specific provider
export REVIEW_PROVIDERS="openrouter/google/gemini-2.0-flash-exp:free"
export OPENROUTER_API_KEY="REPLACE_WITH_YOUR_KEY"
mpr review --dry-run
# Check provider health
# (Self-hosted only - health checks run automatically)| Error Code | Meaning | Solution |
|---|---|---|
ENOENT |
File not found | Check file paths, ensure fetch-depth: 0 in workflow |
EACCES |
Permission denied | Check file permissions, token scopes |
ETIMEDOUT |
Operation timed out | Increase timeout, check network |
ERESOLVE |
Dependency conflict | Clear cache, reinstall dependencies |
ERR_MODULE_NOT_FOUND |
Missing dependency | Run npm install, rebuild native modules |
- README.md - Quick start guide
- Self-Hosted Guide - Docker deployment
- Analytics Guide - Dashboard setup
- Plugin Development - Custom providers
If you've tried the solutions above and still have issues:
- Check existing issues: GitHub Issues
- Create new issue with:
- Error message (full stack trace)
- Configuration (sanitized - no API keys!)
- Steps to reproduce
- Environment (OS, Node version, runner type)
- Relevant logs (from Actions or Docker)
- Discussions: Use GitHub Discussions for questions
- Examples: Check
__tests__directory for usage examples - Source Code: All code is open source - explore to understand behavior
- Node.js version ≥ 20
- All required API keys set in GitHub Secrets
-
GITHUB_TOKENhaspull-requests: writepermission - Workflow has
fetch-depth: 0for incremental review - Provider model names are correct
- No placeholder values in environment variables
- Budget limits not exceeded
- File patterns (include/exclude) are correct
- PR is not labeled with skip labels
- Webhook secret is secure (32+ characters)
- Docker container has built dist files
- Cache directory is writable
- Network allows outbound HTTPS
Last Updated: 2026-01-25 (v0.2.1)