Overview
TheAgent interface defines how the orchestrator interacts with specific AI coding tools. Agent plugins know how to launch agents, detect their activity state, extract session information, and handle restoration.
Plugin Slot: agentDefault Plugin:
claude-code
Interface Definition
Properties
string
required
Plugin name identifier (e.g.
"claude-code", "codex", "aider").string
required
Process name to look for when checking if agent is running (e.g.
"claude", "codex", "aider").'inline' | 'post-launch'
How the initial prompt should be delivered:
"inline"(default): prompt included in launch command (e.g.-pflag)"post-launch": prompt sent viaruntime.sendMessage()after agent starts
"post-launch" for agents where inlining the prompt causes one-shot/exit behavior.Methods
(config: AgentLaunchConfig) => string
required
Get the shell command to launch this agent.Parameters:
config- Launch configuration with session ID, project config, issue, prompt, model, permissions, system prompt
(config: AgentLaunchConfig) => Record<string, string>
required
Get environment variables for the agent process.Parameters:
config- Launch configuration
(terminalOutput: string) => ActivityState
required
Deprecated: Detect agent activity from terminal output (hacky, use
getActivityState() instead).Parameters:terminalOutput- Recent terminal output from runtime
(session: Session, readyThresholdMs?: number) => Promise<ActivityDetection | null>
required
Get current activity state using agent-native mechanism (JSONL, SQLite, etc.). This is the preferred method.Parameters:
session- Session to checkreadyThresholdMs- Milliseconds before “ready” becomes “idle” (default: 300000 = 5 min)
(handle: RuntimeHandle) => Promise<boolean>
required
Check if agent process is running given a runtime handle.Parameters:
handle- Runtime handle from session
(session: Session) => Promise<AgentSessionInfo | null>
required
Extract information from agent’s internal data (summary, cost, session ID).Parameters:
session- Session to extract info from
(session: Session, project: ProjectConfig) => Promise<string | null>
Optional: Get a launch command that resumes a previous session.Parameters:
session- Session to restoreproject- Project configuration
getLaunchCommand())(session: Session) => Promise<void>
Optional: Run setup after agent is launched (e.g. configure MCP servers).Parameters:
session- Newly launched session
(workspacePath: string, config: WorkspaceHooksConfig) => Promise<void>
Optional: Set up agent-specific hooks/config in the workspace for automatic metadata updates.Called once per workspace during
ao init/start and when creating new worktrees.Critical: The dashboard depends on metadata being auto-updated when agents run git/gh commands. Without this, PRs created by agents never show up.Parameters:workspacePath- Path to workspaceconfig- Hooks configuration with data directory and optional session ID
Related Types
AgentLaunchConfig
SessionId
required
Session identifier
ProjectConfig
required
Project configuration from orchestrator config
string
Issue ID if working on a specific issue
string
Initial prompt for the agent
'skip' | 'default'
Permission handling mode
string
Model to use (e.g.
"claude-sonnet-4-20250514")string
System prompt for orchestrator context (short prompts only). Passed via:
- Claude Code:
--append-system-prompt - Codex:
--system-promptor AGENTS.md - Aider:
--system-promptflag
string
Path to file containing system prompt. Preferred for long prompts (e.g. orchestrator prompts) to avoid shell truncation. Takes precedence over
systemPrompt.AgentSessionInfo
string | null
required
Agent’s auto-generated summary of what it’s working on
boolean
True when summary is a fallback (e.g. truncated first user message), not a real agent summary
string | null
required
Agent’s internal session ID for resume
CostEstimate
Cost estimate (tokens and USD)
ActivityDetection
ActivityState
required
Current activity state
Date
When activity was last observed (e.g. agent log file mtime)
WorkspaceHooksConfig
string
required
Data directory where session metadata files are stored
string
Optional session ID (may not be known at
ao init time)CostEstimate
Usage Examples
Implementing an Agent Plugin
Using Agent in Session Manager
Implementation Notes
Prompt Delivery
For agents where-p "prompt" causes immediate exit after completion:
- Set
promptDelivery: "post-launch" - Launch agent in interactive mode
- Send prompt via
runtime.sendMessage()after launch
Activity Detection
PrefergetActivityState() over detectActivity():
- Uses agent-native mechanisms (JSONL logs, SQLite)
- More reliable than terminal output parsing
- Provides timestamps for staleness detection
Workspace Hooks
Critical for dashboard functionality:- Claude Code: write
.claude/settings.jsonwith PostToolUse hook - Hook updates metadata when agent runs
git/ghcommands - Without hooks, PRs created by agents won’t appear in dashboard
Built-in Plugins
- claude-code - Claude Code (default)
- codex - Codex
- aider - Aider
- opencode - OpenCode
