English | 简体中文
Shuttle is a standalone local-first Rust background service that connects GitHub Issues and Pull Requests to local coding agents through a recoverable task queue, posting structured status comments and draft PRs. It runs independently from Loom's inference gateway and quota tooling.
- No public webhooks or uploaded keys: Polls GitHub locally via
ghevery 60 seconds when idle, executing one task at a time without requiring a public callback URL, GitHub Actions runner, or uploading agent API keys to GitHub. - Explicit authorization & safety boundaries: Manual dispatch via labels or slash commands requires repository
write/maintain/adminpermissions. PR tasks bind to the exact 40-character head SHA and cancel automatically if the body or head changes. - Controller-owned publication: Agents never receive GitHub tokens. Validated text changes are committed by the controller via the GitHub Git Data API to a new
shuttle/*branch as a draft PR, with secret scanning and path-escape checks before push.
cargo build --release --locked
./target/release/shuttle init --repo owner/repo --agent pi
./target/release/shuttle policy --agent pi --model hub/deepseek/deepseek-flash --auto-fix true
./target/release/shuttle doctor
./target/release/shuttle bootstrap
./target/release/shuttle installOn a fresh machine, init handles maintainer-dispatched items only. Enable automatic fixing explicitly with policy --auto-fix true, or switch agents and models:
shuttle policy --agent pi --model hub/deepseek/deepseek-flash
shuttle policy --agent codex --model auto
shuttle policy --agent opencode2 --model hub/deepseek/deepseek-flash
# Switch to analyze-only automation
shuttle policy --auto-fix false --auto-triage trueWhen the machine sleeps or shuts down, processing pauses and resumes on wake by re-checking open Issues and PRs (using the GitHub REST Issues API, which includes PRs). Draft PRs are never merged automatically.
| Trigger | Behavior |
|---|---|
agent:codex / agent:antigravity / agent:pi / agent:opencode2 / agent:grok |
Select an agent to analyze (requires exactly one routing label) |
Issue + agent:fix |
Approve the routed agent to fix the issue and open a draft PR |
Comment /agent pi analyze |
Dispatch a specific agent to analyze an Issue or PR |
Issue comment /agent codex fix |
Approve fixing the issue |
PR comment /agent codex fix <40-char head SHA> |
Approve fixing that exact PR head; creates a new draft PR without modifying the author's branch |
agent:paused |
Pause new tasks for this item and block publication of the current task |
Manual label/comment triggers accept only repository write/maintain/admin users. When auto_fix is enabled, the configured repository allowlist defines the fixed automatic policy for new items; issue bodies cannot override the agent, model, tools, or permissions. Draft PRs created by Shuttle do not auto-trigger themselves, though maintainers can dispatch follow-up tasks on them.
shuttle tasks
shuttle report 1
shuttle retry 1
shuttle publish 1
shuttle policy --agent pi
shuttle policy --auto-fix false --auto-triage falsescan: Discovers and records tasks without running agents or commenting on GitHub.once/listen: Runs a single polling cycle or loops continuously.retry/publish:retryre-runs the agent (consuming model quota again);publishretries GitHub publication for an existing patch without re-invoking the model. Publication network failures auto-retry up to 5 times (publication_pending); generation never auto-reruns after failure or restart.- Task states:
queued,running,publishing,publication_pending,completed,failed,blocked,interrupted,cancelled. Default timeout is 30 minutes. - Rolling 24-hour quota cap for automatic analysis/fixes defaults to
20(auto_daily_limit, configurable1–100); tasks exceeding the cap are markedblocked.
- Codex: Uses
codex exec(read-onlyfor analysis,workspace-writefor fixes), ignoring global execution overrides while keeping local auth. - pi: Disables all built-in tools, MCP, skills, project configs, and extension discovery; exposes only the controller's
relay_filetool (list/readfor analysis, addingwrite/removefor fixes). No bash, subagents, or network tools. Uses a privatepi-runtimeconfig synced only forhub/...models without modifying personal pi config files. - OpenCode V2: Separate process (
planfor analysis,buildfor fixes). - Antigravity: Print + sandbox mode (
planfor analysis,accept-editsfor fixes). - Grok Build: Prompt-file mode (
planfor analysis,acceptEditsfor fixes), with web search and subagents disabled.
shuttle doctor verifies executable availability and gh permissions; it does not probe live model calls or account quotas. No silent fallback occurs between agents or models.
- Analysis runs on a plain-text snapshot of the default branch and PR diff; fixes run on a pinned-commit plain-text workspace without loading project plugins. Controlled
.gitcheckouts and private reports live in sibling directories inaccessible to agent file tools. - Because
pidoes not execute repository code, auto-fixes do not claim test execution; generated draft PRs require isolated CI or human review. - Publication runs via
ghand the GitHub Git Data API on a newshuttle/*branch using a GitHub noreply commit author—without executing repository git hooks or local credential helpers, and without uploading free-form agent logs. Pre-publish checks reject hidden control files, auth files, path escapes, symlinks, oversized/binary diffs, and common secret patterns.
- macOS:
~/Library/Application Support/Shuttle(LaunchAgentlocal.shuttle.worker, managed byshuttle install). - Linux:
~/.local/share/Shuttle(runshuttle listenunder your own process supervisor). - Override with
--data-dir. Configuration files never store GitHub tokens.
Stop the macOS background service without deleting local reports or GitHub PRs:
launchctl bootout "gui/$(id -u)/local.shuttle.worker"shuttle/
├── Cargo.toml # Rust package manifest
├── src/
│ ├── main.rs # CLI entry point (init, policy, doctor, scan, once, listen, tasks, report, retry, publish, install)
│ ├── config.rs # Local config, allowlists, policies & AgentRelay migration
│ ├── github.rs # gh CLI wrapper & GitHub Git Data API publication
│ ├── planner.rs # Dispatch parsing, authorization & SHA binding
│ ├── queue.rs # Recoverable local task queue & daily quota tracking
│ ├── service.rs # Polling loop, crash recovery & LaunchAgent installer
│ └── worker.rs # Agent adapter execution, secret scanning & workspace isolation
├── integrations/
│ └── pi-guard.mjs # Restricted relay_file tool guard for pi workers
└── tests/
└── pi-guard.mjs # Regression tests for pi-guard path & permission checks
cargo test --locked
cargo fmt --check
cargo clippy --locked -- -D warnings
node tests/pi-guard.mjsTests run fully offline using a local fake gh binary, covering permission rejection, command parsing, PR SHA binding, event deduplication, crash recovery, agent arguments, and pre-publish secret checks.
Upgrading from Agent Relay
Shuttle takes its name from a loom shuttle carrying tasks between GitHub and local agents.
gh repo clone xdlkc/shuttle
cd shuttle
cargo build --release --locked
./target/release/shuttle install
shuttle doctor
shuttle tasksIf an existing AgentRelay/config.json is present, Shuttle reuses that directory in place—preserving policies, queues, reports, and agent references. The installer migrates LaunchAgent to local.shuttle.worker and keeps agent-relay as a compatibility wrapper. Legacy comment markers and agent-relay/* branches remain recognized to prevent duplicate dispatches.