Run status is derived from events and represents the current state of a run. Understanding statuses is key to effectively managing agent workflows.
stateDiagram-v2
[*] --> queued: orch run
queued --> booting: agent starting
booting --> running: agent ready
running --> waiting: needs human input
running --> rate_limited: API/rate limit issue
running --> pr_open: PR created
running --> done: task complete
running --> failed: error occurred
running --> canceled: orch stop
running --> unknown: agent exited unexpectedly
waiting --> running: input provided (orch attach)
waiting --> canceled: orch stop
rate_limited --> running: issue resolved
rate_limited --> canceled: orch stop
pr_open --> done: PR merged/closed
done --> [*]
failed --> [*]
canceled --> [*]
unknown --> [*]
These indicate the run is in progress or needs attention.
Run has been created but the agent hasn't started yet.
| Aspect | Details |
|---|---|
| What's happening | Run record created, waiting to start |
| User action | Wait (usually transitions quickly) |
| Next status | booting |
Agent is starting up.
| Aspect | Details |
|---|---|
| What's happening | tmux session created, agent launching |
| User action | Wait |
| Next status | running |
| Typical duration | 5-30 seconds |
Agent is actively working on the task.
| Aspect | Details |
|---|---|
| What's happening | Agent analyzing, coding, testing |
| User action | Wait, or attach to watch |
| Next status | waiting, pr_open, done, failed |
Agent needs human input to continue.
| Aspect | Details |
|---|---|
| What's happening | Agent asking a question or waiting for decision |
| User action | orch attach to provide input |
| Next status | running (after input) |
Common reasons for waiting:
- Agent asking clarifying question
- Permission confirmation needed
- Design decision required
- Error needs human judgment
API or rate limit issue preventing progress.
| Aspect | Details |
|---|---|
| What's happening | API key issue, rate limit, service unavailable |
| User action | Check credentials, wait for rate limit reset |
| Next status | running (when resolved) |
Agent has created a pull request.
| Aspect | Details |
|---|---|
| What's happening | PR created, awaiting review/merge |
| User action | Review the PR |
| Next status | done (typically) |
These indicate the run has finished.
Task completed successfully.
| Aspect | Details |
|---|---|
| What's happening | Agent finished the task |
| User action | Review work, merge PR if applicable |
Run encountered an error.
| Aspect | Details |
|---|---|
| What's happening | Unrecoverable error occurred |
| User action | Check logs, fix issue, retry if needed |
Common failure reasons:
- Git conflicts
- Build failures
- Test failures (if agent stops on failure)
- Agent crash
Run was manually stopped.
| Aspect | Details |
|---|---|
| What's happening | User ran orch stop |
| User action | None required |
Agent exited unexpectedly.
| Aspect | Details |
|---|---|
| What's happening | Agent process ended without proper completion |
| User action | Investigate, possibly restart |
The daemon detects this by:
- No Claude/agent UI elements visible
- Shell prompt visible (agent exited to shell)
# Active runs
orch ps --status running,waiting
# All waiting runs
orch ps --status waiting,rate_limited
# Completed runs
orch ps --status done
# Problem runs
orch ps --status failed,unknown-- Count by status
SELECT status, COUNT(*)
FROM runs
GROUP BY status;
-- Running runs with duration
SELECT
issue_id,
run_id,
status,
datetime('now') - created as duration_seconds
FROM runs
WHERE status = 'running';
-- Recently waiting
SELECT * FROM runs
WHERE status = 'waiting'
ORDER BY updated_at DESC
LIMIT 10;queued → booting → running → pr_open → done
queued → booting → running → waiting → running → pr_open → done
queued → booting → running → failed
queued → booting → failed (agent failed to start)
running → unknown (agent crashed)
running → canceled (user stopped)
waiting → canceled (user stopped)
# Quick status check
orch ps
# Watch for changes
watch -n 5 orch ps
# JSON for scripting
orch ps --json | jq '.runs[] | select(.status == "waiting")'Configure Slack notifications for status changes:
slack:
enabled: true
webhook_url: ${SLACK_WEBHOOK}
notify_on:
- waiting
- rate_limited
- failed- Check
orch psregularly - Set up Slack notifications for
waiting - Use
orch attachto provide input - Document common questions in issue templates
- Check daemon logs:
tail .orch/daemon.log - Attach to see error:
orch attach run-ref - Check if issue is retriable
- Use
orch restart-fromto retry from last state
# Simple loop
while true; do
clear
orch ps --status running,waiting,booting
sleep 10
doneOr use orch monitor for an interactive TUI.