Overview
WhenMAGPIE_GITHUB_ORG is set, Magpie dynamically resolves the target repository from the task message. This allows a single Magpie instance to work across multiple repos in the same GitHub organization.
How It Works
Repo Parsing
Magpie uses regex patterns to extract repo names from task messages:Supported patterns:
"fix bug in api-service""add feature in repo backend""update docs in acme/frontend""refactor auth-service"
Example 1: Fix Bug in API Service
Discord Message
Configuration
Pipeline Flow
Diagnostic Blueprint
The Diagnostic blueprint runs in the cloned
api-service repo:- scan-repo — lists files in
/tmp/magpie-ws-a3f9c8d2/api-service - investigate — agent reads payment handler code, finds missing validation
- plan — agent plans to add validation before payment processing
- write-regression-test — test that sends negative amount, expects 400
- verify-test-fails — test fails (currently returns 500)
- implement-fix — add validation:
if amount < 0 { return 400 } - run-tests — all tests pass
- lint-check — clippy passes
Example 2: Add Feature to Frontend Repo
Discord Message
Pipeline Flow
TDD Blueprint
The TDD blueprint runs in the cloned
frontend repo:- scan-repo — lists files in
/tmp/magpie-ws-7d2e4b19/frontend - plan — agent plans component structure, localStorage API, CSS classes
- write-tests — tests for toggle button, localStorage, theme application
- verify-tests-fail — tests fail (feature doesn’t exist)
- implement — create DarkModeToggle component, add CSS, wire up localStorage
- run-tests — all tests pass
- lint-check — eslint passes
Example 3: Cross-Org Protection
Discord Message (Malicious)
Pipeline Response
Repo Name Patterns
Magpie recognizes these patterns in task messages:| Pattern | Example | Extracted Repo |
|---|---|---|
in <repo> | ”fix bug in api-service” | acme/api-service |
in repo <name> | ”add feature in repo backend” | acme/backend |
<org>/<repo> | ”update acme/frontend” | acme/frontend |
Just <repo> | ”refactor auth-service” | acme/auth-service |
MAGPIE_GITHUB_ORG is set, the pipeline fails with:
Configuration
Enable Multi-Repo Mode
Disable Multi-Repo Mode
MAGPIE_GITHUB_ORG is not set, Magpie uses the static MAGPIE_REPO_DIR for all tasks.
Sandbox Types
Local Sandbox (Default)
Daytona Sandbox (Feature-Gated)
Warm Pool (Phase 5 Roadmap)
Performance
| Scenario | Cold Clone | Warm Pool (Future) |
|---|---|---|
| First-time clone | ~2-5 min | under 10 seconds |
| Build cache | None | Pre-warmed |
| Total overhead | ~5-8 min | ~10 sec |
Security
- Org restriction — Only repos in the configured GitHub org are allowed
- No cross-org — Prevents
@magpiefrom accessing external repos - Validation at setup — Fails fast before cloning or creating branches
- Isolated workspaces — Each task gets a fresh temp directory
- Automatic cleanup — Temp workspaces are deleted after pipeline completes
Use Cases
Single Magpie Instance for Microservices
acme org.
Per-Repo Commands
.magpie.toml will override global commands (Phase 2 roadmap).
Limitations
- No cross-org support — All repos must be in the same GitHub org
- No multi-repo tasks — Each task targets exactly one repo
- Cold clone overhead — Cloning + building adds ~5-8 minutes per task
- No repo caching — Each task starts from a fresh clone
Next Steps
Pipeline Configuration
How to configure pipeline settings
Sandbox Types
Local vs Daytona sandboxes
Warm Pool
See the plan for under 10s sandbox acquisition
Repo Resolution
Understand Magpie’s org-scoped repo resolution
Sandbox API
Deep dive into Sandbox trait and implementations
Tracing
Debug with JSONL traces and verbose mode
Testing
Learn how to test Magpie integrations