Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Reactions

Reactions are configurable rules that fire when a session enters a specific state. They are the core of Ennio’s autonomous behavior.

How Reactions Work

  1. The lifecycle manager detects a state change (e.g., CI failed)
  2. It looks up matching reaction rules for the session’s project
  3. It checks the retry count and escalation timeout
  4. It executes the action (send to agent, notify, auto-merge)
  5. If the action fails or the state persists beyond the escalation timeout, it escalates

Reaction Actions

ActionDescription
send_to_agentSends a message to the running agent with instructions
notifySends a notification through configured notifier plugins
auto_mergeMerges the PR via the SCM plugin

Default Reactions

Ennio ships with 9 built-in reactions:

KeyTriggerActionRetriesEscalation
ci-failedCI checks failsend_to_agent2120s
changes-requestedReviewer requests changessend_to_agent1800s
bugbot-commentsBot comments on PRsend_to_agent1800s
merge-conflictsMerge conflicts detectedsend_to_agent900s
approved-and-greenPR approved + CI greennotify
agent-stuckNo activity for thresholdnotify (urgent)600s
agent-needs-inputAgent waiting for inputnotify (urgent)
agent-exitedAgent process exitednotify (urgent)
all-completeAll project sessions donenotify (info)

Configuration

Override reactions globally or per-project:

# Global reactions
reactions:
  ci-failed:
    enabled: true
    action: send_to_agent
    message: "CI failed. Check the logs and fix the issues."
    priority: action
    retries: 3
    escalate_after: 180

  approved-and-green:
    enabled: true
    action: auto_merge   # auto-merge instead of just notifying

projects:
  - name: critical-app
    reactions:
      ci-failed:
        enabled: true
        action: send_to_agent
        message: "CI is red. This is a critical service — fix immediately."
        priority: urgent
        retries: 5
        escalate_after: 60

Project-level reactions override global reactions for matching keys.

Reaction Fields

FieldTypeDefaultDescription
enabledbooltrueWhether this reaction is active
actionReactionAction"notify"What to do when triggered
messageString?Message sent to agent (for send_to_agent)
priorityEventPriority"info"Priority of emitted events
retriesu320Maximum retry attempts
escalate_afterDuration?Seconds before escalating
thresholdDuration?Idle time before triggering (e.g., agent-stuck)
include_summaryboolfalseInclude session summary in notification

Escalation

When a reaction’s escalate_after timeout expires and the state hasn’t changed, Ennio escalates by sending a notification regardless of the original action. This ensures a human is alerted when automated recovery fails.

Event Priority

Reactions emit events with a priority level that affects notification routing:

PriorityUse
InfoStatus updates, completions
ActionSomething needs attention soon
UrgentImmediate human attention required
CriticalSystem-level failures