Branch Controls
Scoped execution controls for a single branch of the swarm.
Install
npx ax-depute@latest add branch-controlspnpm dlx ax-depute@latest add branch-controlsyarn dlx ax-depute@latest add branch-controlsbunx ax-depute@latest add branch-controlsOverview
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.
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
| Prop | Type | Default | Description |
|---|---|---|---|
branchName | string | Required | The display name of the organizational branch or sub-tree. |
status | 'running' | 'paused' | 'quarantined' | Required | The current execution state of this specific branch. |
onPause | () => void | undefined | Callback fired to halt execution on this branch. |
onResume | () => void | undefined | Callback fired to resume execution on this branch. |
onQuarantine | () => void | undefined | Callback fired to isolate this branch (e.g., cut off its network/API access). |
onCancel | () => void | undefined | Callback fired to permanently terminate all agents in this branch. |
onThrottle | () => void | undefined | Callback fired to artificially slow down the loop speed of this branch. |
className | string | undefined | Additional 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.