AO

Reactions

Configure what AO does when CI fails, reviews arrive, agents get stuck, or PRs become ready.

Reactions are AO's automatic responses to session events. They decide whether AO should message an agent, notify a human, or mark a PR as ready for a merge action.

You do not need to configure reactions to start. AO ships with defaults for CI failures, review comments, merge conflicts, stuck agents, input prompts, and completed sessions.

Common Recipes

Watch Without Auto-Recovery

Use this while onboarding AO to a sensitive repo. You still see notifications, but AO stops sending recovery prompts to agents automatically.

agent-orchestrator.yaml
reactions:
  ci-failed:
    auto: false
  changes-requested:
    auto: false
  bugbot-comments:
    auto: false
  merge-conflicts:
    auto: false

Give CI Recovery More Attempts

agent-orchestrator.yaml
reactions:
  ci-failed:
    retries: 3
    message: |
      CI is failing. Read the failing check logs, reproduce locally when possible,
      fix the smallest cause, and push the correction.

Escalate Stuck Agents Faster

agent-orchestrator.yaml
reactions:
  agent-stuck:
    priority: urgent
    threshold: "7m"

Notify On Merge-Ready PRs

approved-and-green does not merge by default. It notifies you that the PR is ready.

agent-orchestrator.yaml
reactions:
  approved-and-green:
    auto: false
    action: notify
    priority: action

auto-merge is currently an intent flag, not a bypass. AO does not ignore branch protection, reviews, or failing checks.

Default Reactions

KeyWhen it firesDefault actionNotes
ci-failedCI check failssend-to-agentSends the agent a recovery prompt
changes-requestedHuman requests changessend-to-agentSends review feedback to the agent
bugbot-commentsKnown automation leaves actionable feedbacksend-to-agentKeeps bot feedback separate from human reviews
merge-conflictsPR has conflictssend-to-agentAsks the agent to resolve conflicts
approved-and-greenPR is approved and checks passnotifyDoes not merge unless future SCM support enables it
agent-stuckAgent has been inactive past thresholdnotifyUrgent by default
agent-needs-inputAgent is waiting for human inputnotifyUrgent by default
agent-exitedSession exits unexpectedly or is killednotifyUrgent by default
all-completeSession finishes cleanlynotifyIncludes summary by default
agent-idleReservedsend-to-agentDefined for future idle handling

Action Types

ActionMeaning
send-to-agentSends message into the running agent session
notifyRoutes an event to configured notifiers
auto-mergeReserved merge intent; currently routes like a notification

send-to-agent is the autonomous recovery path. notify is the human awareness path.

Config Fields

Each reaction accepts:

FieldTypePurpose
autobooleanWhether AO should perform the automated action
actionsend-to-agent | notify | auto-mergeWhat AO does when the reaction fires
messagestringMessage sent to the agent or included in notification text
priorityurgent | action | warning | infoNotification routing priority
retriesnumberMax repeated agent messages before escalation
escalateAfternumber or duration stringEscalate after attempts or time, whichever applies
thresholdduration stringUsed by stuck/idle style reactions
includeSummarybooleanInclude session summary in the notification

Example:

reactions:
  changes-requested:
    action: send-to-agent
    retries: 2
    escalateAfter: "30m"
    message: |
      Reviewers requested changes. Read the unresolved comments,
      make the requested fixes, and push an update.

Notification Routing

Reaction priority maps to notificationRouting in the global config:

~/.agent-orchestrator/config.yaml
notificationRouting:
  urgent: [desktop, composio]
  action: [desktop]
  warning: [composio]
  info: [composio]

Named notifier instances are configured separately:

~/.agent-orchestrator/config.yaml
notifiers:
  desktop:
    plugin: desktop
  slack:
    plugin: slack
    webhookUrl: ${SLACK_WEBHOOK_URL}

Per-Project Overrides

Put reaction overrides in a local project config to affect only that project:

agent-orchestrator.yaml
reactions:
  ci-failed:
    retries: 4
  approved-and-green:
    priority: info

Project values override global values for the same reaction key.

CI Failure Flow

CI failure handling happens in two passes:

  1. AO sends the configured ci-failed.message when the session first enters a failed-CI state.
  2. On the next poll, AO sends a structured follow-up with the failing check names, statuses, and URLs.

The second message does not consume the ci-failed retry budget. It exists so the agent gets both the instruction and the specific failing checks.

Review Backlog Throttle

AO throttles review-comment lookups to avoid hammering GitHub or GitLab. Pending human comments and known automation comments are fetched at most once every two minutes per session.

Force a check when you need one immediately:

ao review-check <session-id>

Event Reference

EventReaction
ci.failingci-failed
review.changes_requestedchanges-requested
automated_review.foundbugbot-comments
merge.conflictsmerge-conflicts
merge.readyapproved-and-green
session.stuckagent-stuck
session.needs_inputagent-needs-input
session.killedagent-exited
summary.all_completeall-complete

Next Steps