open-pilot

Open Pilot is a self-hosted Gitea + OpenCode automation service: a webhook receives ready-issue events, a local queue/worker claims the job, OpenCode edits in a git worktree, tests run, and the branch is pushed back as a PR.

Status: the core issue-to-PR runner, webhook receiver, durable queue, dashboard, logging, supervisor/autopilot helpers, and smart scheduler are implemented. Treat it as a trusted self-hosted MVP, not a hardened multi-tenant service; see docs/security.md before exposing it broadly.

Workflow

Gitea issue -> webhook -> queue -> runner -> OpenCode -> tests -> commit/push -> PR

Repository:

  • Local path: /home/onnwee/Projects/subcult/open-pilot
  • Remote URL: ssh://[email protected]:2222/PatrickFanella/open-pilot.git

Docs:

Manual runner demo command:

open-pilot run-issue PatrickFanella/paqr 13

The default runtime remains conservative: FIFO queueing, one worker at a time, dashboard disabled, and scheduler disabled unless explicitly enabled.

Optional runtime features:

  • OPEN_PILOT_POLICY_PATH for per-repo policy profiles
  • OPEN_PILOT_DASHBOARD_ENABLED and OPEN_PILOT_DASHBOARD_TOKEN for the local dashboard
  • OPEN_PILOT_SCHEDULER_ENABLED to switch from FIFO claims to score-based scheduling; leave it false until the scheduler rollout gate passes
  • OPEN_PILOT_OPENCODE_SESSION_MODE and OPEN_PILOT_OPENCODE_SESSION_FORK_ANCHOR to control OpenCode session reuse
  • OPEN_PILOT_SANDBOX_ENABLED for containerized OpenCode runs
  • OPEN_PILOT_REVIEWER_LOOP_ENABLED for the pre-PR critique pass

Logging:

  • OPEN_PILOT_LOG_LEVEL=WARNING by default so JSON CLI output stays clean.
  • OPEN_PILOT_LOG_FORMAT=text or json.
  • CLI overrides are available with --log-level and --log-format.
  • Captured agent/test output is redacted before being logged or stored.

Docker packaging is documented in Dockerfile and docker-compose.yml.

Common commands

make install
make test
make compose-config
make compose-build
make scheduler-explain
make scheduler-locks

Runtime notes

  • Webhook jobs require ready-for-agent and agent:queued labels, an allowlisted repo, and a trusted sender.
  • OPEN_PILOT_ALLOWED_REPOS=* and OPEN_PILOT_TRUSTED_USERS=* are supported for private/internal deployments, but they deliberately widen the trust boundary.
  • Dashboard routes (/dashboard, /dashboard.json) require OPEN_PILOT_DASHBOARD_ENABLED=true; if OPEN_PILOT_DASHBOARD_TOKEN is set, callers must send X-Open-Pilot-Dashboard-Token.
  • Smart scheduler mode is enabled with OPEN_PILOT_SCHEDULER_ENABLED=true; it scores queued jobs, enforces one active job per repo by default, and records scheduler events/history in SQLite.
  • OpenCode session state is stored in the SQLite runtime DB under .open-pilot/open-pilot.db; default continuity is per-repo-fork with a rolling repo anchor.
S
Description
Self-hosted Gitea automation that turns ready issues into tested pull requests with OpenCode workers.
Readme GPL-3.0
1.2 MiB
Languages
Python 82.6%
TypeScript 16.6%
CSS 0.4%
Makefile 0.2%
Dockerfile 0.1%
Other 0.1%