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)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§
- agents
- Per-agent runner trait, error types, and agent registry.
- ci
- CI timers, required checks and red CI context
- git
- Git work in task worktrees: commits, pushes, PRs, worktree setup and diffs
- review
- PR review pipeline — review agent orchestration.
- router
- Agent router — selects the best agent and model for each task.
- runner
- Task runner — executes tasks using AI agents.
- service
- The daemon around the engine: the service loop, startup, channel messages, the relay client and the control session
- subscribers
- 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.
- RunTimeouts
- The limit the
timeoutwrapper puts on one agent run, per complexity
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. - RUN_
TIMEOUT_ GRACE_ SECS - Seconds a live session may run past its own timeout before stuck recovery takes it. The
timeoutwrapper ends the agent at the limit, and the runner still collects the result
Traits§
- WebUi
- Start the orch service.
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 - serve