Skip to main content

Module engine

Module engine 

Source
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§

EngineConfig
Engine configuration.
ProjectEngine
Per-project engine state.

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 agents in config.yml, falling back to router::config::DEFAULT_AGENTS when not set.
orch_footer
Standard Orch attribution footer for issue bodies, PR bodies, and comments.
serve
Start the orch service.