bosun
v0.36.6
Published
AI-powered orchestrator supervisor — manages AI agent executors with failover, auto-restarts on failure, analyzes crashes with Codex SDK, creates PRs via Vibe-Kanban API, and sends Telegram notifications. Supports N executors with weighted distribution, m
Maintainers
Readme
Bosun is a production-grade supervisor for AI coding agents. It routes tasks across executors, automates PR lifecycles, and keeps operators in control through Telegram, the Mini App dashboard, and optional WhatsApp notifications.
Quick start
npm install -g bosun
cd your-repo
bosunFirst run launches setup automatically. You can also run setup directly:
bosun --setupRequires:
- Node.js 18+
- Git
- Bash (for
.shwrappers) or PowerShell 7+ (for.ps1wrappers) - GitHub CLI (
gh) recommended
Permanent Mini App Hostname + Fallback Auth
Bosun defaults the Mini App tunnel to named mode so the Telegram URL can stay stable (<user>.<base-domain>), with quick tunnels only as explicit fallback.
Required Cloudflare settings:
CLOUDFLARE_TUNNEL_NAMECLOUDFLARE_TUNNEL_CREDENTIALSCLOUDFLARE_BASE_DOMAIN(for examplebosun.det.io)CLOUDFLARE_ZONE_IDCLOUDFLARE_API_TOKEN(Zone DNS edit scope for the target zone)
Useful optional settings:
CLOUDFLARE_TUNNEL_HOSTNAME(explicit hostname override)CLOUDFLARE_USERNAME_HOSTNAME_POLICY=per-user-fixedTELEGRAM_UI_ALLOW_QUICK_TUNNEL_FALLBACK=false
Fallback admin auth (secondary path) is available and stores only Argon2id hash + salt, never plaintext. Use:
POST /api/auth/fallback/setto set/rotatePOST /api/auth/fallback/rotateas explicit rotate aliasPOST /api/auth/fallback/resetto clearPOST /api/auth/fallback/loginto mint normalve_sessioncookie
What Bosun does
- Routes work across Codex, Copilot, Claude, and OpenCode executors
- Automates retries, failover, and PR lifecycle management
- Auto-labels attached PRs with
bosun-needs-fixwhen CI fails (Build + Tests) - Merges passing PRs automatically through the Bosun PR Watchdog with a mandatory review gate (prevents destructive merges)
- Persists workflow runs to disk and auto-resumes on restart
- Monitors runs and recovers from stalled or broken states
- Provides Telegram control and a Mini App dashboard
- Integrates with GitHub, Jira, and Vibe-Kanban boards
Executor quick-start
| Executor | primaryAgent value | Key env vars |
| ----------------- | -------------------- | ------------------------------------------------------------------------------------- |
| Codex (OpenAI) | codex-sdk | OPENAI_API_KEY |
| Copilot (VS Code) | copilot-sdk | VS Code session |
| Claude | claude-sdk | ANTHROPIC_API_KEY |
| OpenCode | opencode-sdk | OPENCODE_MODEL (e.g. anthropic/claude-opus-4-5), OPENCODE_PORT (default 4096) |
Set primaryAgent in .bosun/bosun.config.json or choose an executor preset during bosun --setup.
Telegram weekly report
- Run
/weeklyto generate the operator weekly agent-work report on demand. - Use
/report weeklyas an alias. - Optional scheduler knobs in
.env:TELEGRAM_WEEKLY_REPORT_ENABLED,TELEGRAM_WEEKLY_REPORT_DAY,TELEGRAM_WEEKLY_REPORT_HOUR(UTC), andTELEGRAM_WEEKLY_REPORT_DAYS.
Documentation
Published docs (website): https://bosun.virtengine.com/docs/
Source docs (markdown): _docs/ is the source of truth for long-form documentation. The website should be generated from the same markdown content so docs stay in sync.
Key references:
- GitHub adapter enhancements
- GitHub Projects v2 index
- GitHub Projects v2 quickstart
- GitHub Projects v2 API
- GitHub Projects v2 monitoring
- GitHub Projects v2 checklist
- Jira integration
- Workflows
- Agent logging quickstart
- Agent logging design
- Agent logging summary
CI/CD and quality gates
Bosun enforces a strict quality pipeline in both local hooks and CI:
- Pre-commit hooks auto-format and lint staged files.
- Pre-push hooks run targeted checks based on changed files (Go, portal, docs).
- Demo load smoke test runs in
npm testand blocks push ifsite/indexv2.htmlorsite/ui/demo.htmlfails to load required assets. - Prepublish checks validate package contents and release readiness.
Local commands you can run any time:
# Syntax + tests for bosun package
npm test
# Prepublish safety checks
npm run prepublishOnly
# Install local git hooks (pre-commit + pre-push)
npm run hooks:installRepository layout
cli.mjs— entrypoint for the supervisormonitor.mjs— main orchestration loopconfig.mjs— unified config loaderui-server.mjs— Telegram Mini App backendsite/— marketing + docs websitedocs/and_docs/— documentation sources (markdown)
License
Apache-2.0
