Depute Logo

Escalation Router

Alert feed for sub-agent failures with routing options.

Install

npx ax-depute@latest add escalation-router
pnpm dlx ax-depute@latest add escalation-router
yarn dlx ax-depute@latest add escalation-router
bunx ax-depute@latest add escalation-router

Overview

A high-severity intervention surface. When an agent critically fails (e.g., gets stuck in a loop, hits a rate limit, or crashes), Escalation Router surfaces the error trace and provides the human supervisor with three deterministic resolution paths: Retry, Reassign, or Cancel.

Agent Failure EscalatedSynthesizer-Z · branch branch-k6na925
Failed

Agent entered an infinite loop: detected the same tool call 5 times with no state change.

System Recommendation↺ Retry with same agent
Interactive StorybookView all states, toggle props, and test edge cases.

Basic usage

import { EscalationRouter } from '@/components/EscalationRouter';

export function App() {
  return (
    <div className="p-4 border border-zinc-200 dark:border-zinc-800 rounded-lg max-w-lg">
      <EscalationRouter 
        failedAgent="Data Processor Node"
        branchId="branch_7A"
        errorSummary="Database Timeout: Allowed duration exceeded (3000ms)"
        errorTrace="Error: Connection refused at pg_connect() \n at query (db.js:42:12)"
        recommendation="retry"
        onRetry={() => console.log('Retrying task on same agent...')}
        onReassign={() => console.log('Opening reassignment modal...')}
        onCancelBranch={() => console.log('Killing branch_7A')}
      />
    </div>
  );
}

Props

PropTypeDefaultDescription
failedAgentstringRequiredThe name or ID of the agent that encountered the critical error.
errorSummarystringRequiredA human-readable, single-sentence summary of what went wrong.
onRetry() => voidRequiredCallback fired when the human chooses to restart the failed task on the same agent.
onReassign() => voidRequiredCallback fired when the human chooses to route the task to a different agent.
onCancelBranch() => voidRequiredCallback fired to terminate the task and explicitly fail the workflow branch.
branchIdstringundefinedThe specific execution branch or thread ID associated with the task.
errorTracestringundefinedThe raw system error, API response, or stack trace (rendered in a dark-themed code block).
recommendation'retry' | 'reassign' | 'cancel'undefinedThe orchestrator's suggestion for how the human should resolve the issue (highlights the primary button).
classNamestringundefinedAdditional CSS class for the root element.

Composition flow

Escalation Router surfaces hard blockers from deep within the swarm up to the human supervisor:

Failed Subagent → [Escalation Router] → Human Override

It allows the user to re-route or manually resolve the blocker.

Design rationale

1. The "Three-Way Intersection"
When autonomous systems fail, they often just stop or loop infinitely. Escalation Router forces the system to pause and present a clear three-way intersection to the human: Try Again (transient errors), Give to Someone Else (capability errors), or Give Up (bad intent/unsolvable).

2. Visual Urgency
This is one of the few components in the library that uses aggressive Red styling by default. It acts as an alertdialog, breaking the user out of passive monitoring and demanding active resolution.

3. Orchestrator Recommendations
If the orchestrator is intelligent enough to know why an agent failed (e.g., a 429 Rate Limit), it can use the recommendation prop. This highlights the "Retry" button as the primary action, turning the human into a simple "Approve" clicker rather than forcing them to diagnose the trace themselves.

On this page