Orchestrate parallel AI coding agents across git worktrees for autonomous CI fixes, code reviews, and PR management
triggers
["set up agent orchestrator for parallel coding","spawn multiple AI agents to work on different issues","configure autonomous CI failure handling","create isolated git worktrees for parallel agents","automate code review responses with AI agents","orchestrate multi-agent coding tasks","manage fleet of coding agents with reactions","run parallel AI agents on different branches"]
Agent Orchestrator is an agentic orchestration layer that spawns parallel AI coding agents, each in its own git worktree. Agents autonomously fix CI failures, address review comments, and open PRs while you supervise from a unified dashboard.
git clone https://github.com/ComposioHQ/agent-orchestrator.git
cd agent-orchestrator
bash scripts/setup.sh
Prerequisites
Node.js 20+
Git 2.25+ (worktree support)
gh CLI (authenticated)
macOS/Linux: tmux (brew install tmux or sudo apt install tmux)
Windows: PowerShell 7+ (uses native ConPTY, no tmux needed)
Quick Start
Start from GitHub URL
ao start https://github.com/your-org/your-repo
Start from Local Repo
cd ~/your-project
ao start
Start Multiple Projects
ao start ~/path/to/project-one
ao start https://github.com/org/project-two
The dashboard opens at http://localhost:3000 by default.
Configuration
On first run, ao start generates agent-orchestrator.yaml:
$schema:https://raw.githubusercontent.com/ComposioHQ/agent-orchestrator/main/schema/config.schema.jsonport:3000defaults:runtime:tmux# tmux on macOS/Linux, process on Windowsagent:claude-code# or codex, aider, cursor, opencode, kimicodeworkspace:worktree# or clonenotifiers: [desktop]
projects:my-app:repo:owner/my-apppath:~/my-appdefaultBranch:mainsessionPrefix:appreactions:ci-failed:auto:trueaction:send-to-agentretries:2changes-requested:auto:trueaction:send-to-agentescalateAfter:30mapproved-and-green:auto:false# Set to true for auto-mergeaction:notifypower:preventIdleSleep:true# Keeps Mac awake for remote access
# List all active sessions
ao list
# Start a new agent session
ao new "Fix login validation bug" --project my-app --issue 123
# Attach to existing session
ao attach my-app-fix-login
# Stop a session
ao stop my-app-fix-login
# Stop all sessions for a project
ao stop --project my-app --all
Project Management
# Add project
ao add-project ~/path/to/repo
# Remove project
ao remove-project my-app
# Show configuration
ao config-help
Status & Monitoring
# Show all sessions and their status
ao status
# Show detailed session info
ao status my-app-fix-login
# View logs
ao logs my-app-fix-login
Zsh Completion
# Generate completion filemkdir -p ~/.zsh/completions
ao completion zsh > ~/.zsh/completions/_ao
# Add to ~/.zshrc before compinit
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit
compinit
Plugin Configuration
Runtime Plugins
defaults:runtime:tmux# or process, docker
tmux (default on macOS/Linux):
Persistent sessions
Attach from multiple terminals
Scrollback history
process (default on Windows):
Native ConPTY support
No tmux dependency
Set AO_SHELL=bash for Git Bash
docker:
Complete isolation
Reproducible environments
Agent Plugins
defaults:agent:claude-code# or codex, aider, cursor, opencode, kimicode
Each agent plugin implements the AgentPlugin interface:
The agent gets review comments and attempts to address them. If not resolved in 30 minutes, you're notified.
Auto-Merge on Approval
reactions:approved-and-green:auto:true# Enable auto-mergeaction:mergestrategy:squash# or merge, rebasedeleteAfter:true
When PR is approved and CI passes, automatically merge and delete the branch.
Custom Reactions
reactions:label-added:auto:truecondition:"label == 'needs-tests'"action:send-to-agentmessage:"Please add tests for this change"
Working with Sessions
Creating a Session Programmatically
import { SessionManager } from'@aoagents/core';
const manager = newSessionManager();
const session = await manager.create({
projectId: 'my-app',
name: 'fix-auth-bug',
issue: 'GH-456',
branch: 'fix/auth-validation',
agent: 'claude-code',
runtime: 'tmux',
workspace: 'worktree'
});
// Session is now running in isolated worktreeconsole.log(`Session ${session.id} started at ${session.workspacePath}`);
Sending Messages to Agent
# Via CLI
ao send my-app-fix-auth "Review the authentication flow in src/auth.ts"# Via API
ao api POST /sessions/my-app-fix-auth/message -d '{"content":"Check the auth flow"}'
Agent Orchestrator uses git worktrees to isolate agents:
# Worktrees are automatically created under:
~/my-app/.worktrees/fix-auth-bug/
# Each worktree has its own:# - Working directory# - HEAD pointer# - Index# - Branch
Worktree Cleanup
# Cleanup happens automatically on session stop
ao stop my-app-fix-auth
# Manual cleanup if neededcd ~/my-app
git worktree remove .worktrees/fix-auth-bug
git branch -D fix/auth-validation
Dashboard API
The orchestrator exposes a REST API (default port 3000):
# Install tmux
brew install tmux # macOSsudo apt install tmux # Ubuntu/Debian# Or switch to process runtime
ao config set defaults.runtime process
Agent Not Responding
# Check session logs
ao logs session-name
# Check agent process
ao status session-name
# Restart session
ao stop session-name
ao new "Same task" --project my-app --issue 123
Port Already in Use
# agent-orchestrator.yamlport:3001# Change from default 3000
GitHub Auth Issues
# Re-authenticate gh CLI
gh auth login
# Verify token has required scopes
gh auth status
Merge Conflicts in Worktree
# Agent handles automatically via reaction# Or attach and resolve manually
ao attach session-name
# Inside session: resolve conflicts, commit, push
Best Practices
One issue per session: Each agent works on a single, well-defined task
Use worktrees: Better isolation and performance than clones
Configure reactions: Automate CI fixes and review responses
Monitor dashboard: Track progress across all agents
Escalate complex decisions: Let agents handle routine, you handle judgment calls
Clean up regularly: Remove merged branches and completed worktrees
Test reactions: Start with auto: false, validate behavior, then enable
Use session prefixes: Organize sessions by project for clarity
Remote Access
# Keep Mac awake for remote dashboard accesspower:preventIdleSleep:true# Default on macOS
Access dashboard remotely via Tailscale or VPN:
http://your-mac-tailscale-ip:3000
Note: Lid-close sleep cannot be prevented on macOS. Use clamshell mode (external display + power) for lid-closed access.
Development & Testing
# Clone and build
git clone https://github.com/ComposioHQ/agent-orchestrator.git
cd agent-orchestrator
pnpm install
pnpm build
# Run tests (3,288 test cases)
pnpm test# Start dev server
pnpm dev
# Build pluginscd packages/plugin-agent-custom
pnpm build
Advanced: Custom Orchestrator Agent
Create a custom orchestrator that uses different planning logic:
This skill covers the complete usage of Agent Orchestrator for spawning and managing parallel AI coding agents with autonomous reactions, git worktree isolation, and extensible plugin architecture.