Depute Logo

Branch Controls

Scoped execution controls for a single branch of the swarm.

Install

npx ax-depute@latest add branch-controls
pnpm dlx ax-depute@latest add branch-controls
yarn dlx ax-depute@latest add branch-controls
bunx ax-depute@latest add branch-controls

Overview

While Run Controls operates on a single agent, and Swarm Monitor can kill the entire fleet, Branch Controls operates on a specific sub-tree. It allows a supervisor to pause or quarantine a troubled workflow branch without freezing the rest of the healthy swarm.

Branchbranch-auth-3a
Running
Interactive StorybookView all states, toggle props, and test edge cases.

Basic usage

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

export function App() {
  return (
    <div className="p-4 border border-zinc-200 dark:border-zinc-800 rounded-lg max-w-sm">
      <BranchControls 
        branchName="Data Scraping Pipeline"
        status="running"
        onPause={() => console.log('Pausing branch')}
        onResume={() => console.log('Resuming branch')}
        onQuarantine={() => console.log('Quarantining branch')}
        onCancel={() => console.log('Canceling branch')}
        onThrottle={() => console.log('Throttling branch speed')}
      />
    </div>
  );
}

Props

PropTypeDefaultDescription
branchNamestringRequiredThe display name of the organizational branch or sub-tree.
status'running' | 'paused' | 'quarantined'RequiredThe current execution state of this specific branch.
onPause() => voidundefinedCallback fired to halt execution on this branch.
onResume() => voidundefinedCallback fired to resume execution on this branch.
onQuarantine() => voidundefinedCallback fired to isolate this branch (e.g., cut off its network/API access).
onCancel() => voidundefinedCallback fired to permanently terminate all agents in this branch.
onThrottle() => voidundefinedCallback fired to artificially slow down the loop speed of this branch.
classNamestringundefinedAdditional CSS class for the root element.

Composition flow

Branch Controls is applied to sub-trees within an Orchestrator View:

Orchestrator View → Tree Node → [Branch Controls]

Rather than stopping the entire swarm, it pauses a specific branch of execution.

Design rationale

1. Surgical Intervention
In a 20-agent swarm, one agent hitting a bad API shouldn't crash the other 19. Branch Controls provides the surgical tools needed to manage a complex hierarchical system. If a "Scraper" branch is misbehaving, you can pause it, adjust the scraper prompt, and resume it, all while the "Summary" branch continues to process the data already collected.

2. The Quarantine Concept
Unlike "Pause" (which stops the agent from reasoning), "Quarantine" allows the branch to continue thinking but revokes its Write/Execute permissions. This is a critical debugging state: it lets the human observe what the agent wants to do next without actually letting it do it.

3. State-Driven UI
The visible buttons dynamically swap based on the status prop. If the branch is running, the user sees Pause and Quarantine. If it's paused, they see Resume. This prevents the supervisor from clicking invalid state transitions during a fast-moving escalation.

On this page