Common issues and solutions when using Repatch.
Cause: Binary not in PATH after one-line install.
Fix:
# Linux/macOS - add to PATH
export PATH="$HOME/.local/bin:$PATH"
# Or restart your shell
# Windows - add to PATH via System Properties > Environment VariablesCause: Script not executable.
Fix:
chmod +x install.sh
./install.shCause: Tap not added or outdated.
Fix:
brew tap Sagar-024/repatch
brew update
brew install repatchCommon causes:
| Check | Fix |
|---|---|
Docker not running |
Start Docker Desktop, or use --local flag |
No LLM provider configured |
Run repatch configure or set env vars |
GitHub token invalid |
Check GH_TOKEN or .repatch.yaml |
Node.js version < 20 |
Upgrade Node.js |
Cause: No default model set and no --model flag.
Fix:
repatch configure # Interactive setup
# OR
export AI_MODEL=gpt-4oError: Invalid API key
Fix:
- Verify key in
.repatch.yamlor environment variable - Check key has correct permissions (OpenAI:
gpt-4oaccess) - Ensure no extra whitespace in config file
Cause: Docker not running or no permission.
Fix:
# Start Docker Desktop (macOS/Windows)
# Linux: sudo systemctl start docker
# Or run without Docker:
repatch fix <url> -i "issue" --localCause: Docker disk full.
Fix:
docker system prune -a # Remove unused images/containers
# Or increase Docker disk limit in Docker Desktop settingsCause: Network disabled or registry issues.
Fix:
# Enable network in config:
# .repatch.yaml
sandbox:
network: true
# Or use --local mode with host network
repatch fix <url> -i "issue" --localCause: Language runtime not installed on host.
Fix:
# Install required runtime:
# Node.js: https://nodejs.org/
# Python: https://python.org/
# Go: https://golang.org/dl/
# Rust: https://rustup.rs/Cause: No write permission in repo directory.
Fix:
# Ensure you own the repo directory
sudo chown -R $USER:$USER /path/to/repo
# Or run with proper permissionsCause: API rate limit hit.
Fix:
- Wait and retry
- Use a different provider:
--model claude-3-5-sonnet-latest - Add budget limit to slow down:
--budget 0.10
Cause: Issue + codebase too large for model context.
Fix:
- Use model with larger context (GPT-4o: 128k, Claude: 200k)
- Narrow issue scope with
-h "hint"to focus exploration - Split large repos into smaller modules
Cause: Issue text contains patterns flagged by sanitizer.
Fix:
- Simplify issue description
- Avoid code-like patterns in issue text
- Report false positives on GitHub
Cause: Gemini CLI output format changed.
Fix:
- Update to latest version:
npm install -g @google/generative-ai - Or use Gemini API instead: set
gemini.apiKeyin config
Cause: Fix didn't address root cause, or test is flaky.
What happens: Repatch automatically backtracks VERIFY → PLAN → EXECUTE up to 3 times.
If stuck:
- Check
--budgetnot exhausted - Add hint:
-h "Focus on X module" - Run
repatch reproducefirst to verify reproduction
Cause: LLM's edit snippet doesn't match source code.
Fix:
- Run
repatch exploreto verify file contents - Add more specific hint:
-h "File is src/auth/middleware.ts" - Check for whitespace/encoding issues in source
Cause: No GitHub token, or token lacks repo scope.
Fix:
# Ensure token has repo scope
# GitHub Settings > Developer settings > Personal access tokens > repo
export GH_TOKEN=ghp_...Cause: Previous run created same branch.
Fix:
# Clean up remote branch
git push origin --delete repatch/fix-<issue-hash>
# Or let Repatch handle it (auto-generates unique branch names)Typical causes:
- Large repo (many files to scan)
- Slow LLM provider
- Docker image build on first run
Mitigations:
# Use local mode (faster startup)
repatch fix <url> -i "issue" --local
# Use faster model
repatch fix <url> -i "issue" --model gpt-4o-mini
# Limit exploration scope
repatch fix <url> -i "issue" -h "Only look at src/api/"Monitor: repatch fix --budget 0.50 enforces hard limit.
Reduce:
- Use cheaper model:
gpt-4o-mini,gemini-1.5-flash - Narrow hints to reduce exploration
- Fix one issue at a time (not
fix-multi)
DEBUG=1 repatch fix <url> -i "issue"Shows:
- LLM prompts/responses (truncated)
- Tool calls with arguments
- State transitions
- Sandbox commands
# After crash or --resume
cat .repatch-checkpoint.jsonContains:
currentStep— where it stoppedvisitedFiles— what was exploredissue— original issue textcost— accumulated spend
repatch reproduce <url> -i "issue"Read-only, stops after REPRODUCE step. Useful for verifying bug exists.
repatch explore . -q "How does authentication work?"Understand codebase before running fix loop.
| Error | Meaning | Action |
|---|---|---|
ENOENT: no such file |
File not found in sandbox | Check path, use --local |
EACCES: permission denied |
Write permission issue | Fix file permissions |
ETIMEDOUT |
Sandbox command timeout | Increase timeout, simplify test |
ZOD_VALIDATION_ERROR |
Config/schema invalid | Run repatch configure |
GITHUB_API_ERROR |
GitHub API failed | Check token, rate limits |
- Check logs with
DEBUG=1 - Search issues — GitHub Issues
- Open new issue with:
- Command run
- Full error output
repatch checkoutput.repatch-checkpoint.json(if applicable)
| Issue | Workaround |
|---|---|
| Docker not available | Use --local flag |
| Gemini CLI parsing fails | Use Gemini API key instead |
| Large repo context overflow | Add specific -h hint |
| Flaky tests cause backtrack loop | Fix test in repo, or increase --budget |
| Windows path issues in Docker | Use --local or WSL2 |