Expand description
Engine — the core orchestration loop.
The engine is the central coordinator. It owns the tick loop, backend connections, channel registry, transport layer, and tmux session manager.
Submodules handle the heavy lifting:
tick— core tick phases (session polling, stuck recovery, routing, dispatch)sync— periodic sync operations (cleanup, PR review, mentions, skills)review— PR review pipeline (review agent, auto-merge, change handling)cleanup— worktree cleanup and merged-PR detection
This file contains struct definitions, project initialization, and the
main event loop (serve()).
Modules§
- auto_
merge - PR auto-merge and review-changes handling.
- channel_
handler - Channel message handlers — routes incoming channel messages to the appropriate action.
- cleanup
- Worktree cleanup and merged-PR detection.
- commands
- Owner slash commands — parse, validate, and execute /commands in issue comments.
- cooldown
- Per-agent and per-model cooldown tracking.
- dependencies
- Sync GitHub blocked-by links into SQLite and hold tasks until those links are done.
- dispatch_
guard - RAII guard for the per-task dispatching
DashMap. - events
- Task event bus — broadcast channel for status transitions.
- jobs
- Job scheduler — replaces
jobs_tick.sh. - review
- PR review pipeline — review agent orchestration.
- review_
poll - PR review polling —
review_open_prs. - router
- Agent router — selects the best agent and model for each task.
- runner
- Task runner — executes tasks using AI agents.
- subscribers
- suspend
- Host suspend/resume detection.
- sync
- Sync tick — periodic operations that run less frequently than the core tick.
- tasks
- tick
- Core tick loop phases.
Structs§
- Engine
Config - Engine configuration.
- Project
Engine - Per-project engine state.
Constants§
- RATE_
LIMITED_ UNTIL_ KEY - KV key holding the epoch second the GitHub core window resets, so
orch task statuscan show the limit from a separate process.
Functions§
- attribution_
footer - Build a standard attribution footer for GitHub comments posted by orch bots.
- configured_
agents - Return the configured agent list from top-level
agentsin config.yml, falling back torouter::config::DEFAULT_AGENTSwhen not set. - format_
rate_ limited_ until - Format an epoch second as a local
HH:MM:SSfor operator-facing output. - orch_
footer - Standard Orch attribution footer for issue bodies, PR bodies, and comments.
- serve
- Start the orch service.