pi-actor-subagents
Run persistent actor-style subagent swarms inside pi.
Package details
Install pi-actor-subagents from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-actor-subagents- Package
pi-actor-subagents- Version
0.1.37- Published
- Nov 3, 2026
- Downloads
- 1,894/mo · 555/wk
- Author
- fdietze
- License
- MIT
- Types
- extension
- Size
- 283.6 KB
- Dependencies
- 0 dependencies · 4 peers
Pi manifest JSON
{
"extensions": [
"extensions/actor-subagents/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-actor-subagents
Build arbitrary agent hierarchies in Pi where every agent can message every other agent. Inspect their conversations and steer them directly. Agents survive Pi restarts.
Pairs well with pi-infinite-context for long-running conversations.
Install
Requires Pi 1.2.0 or newer.
pi install npm:pi-actor-subagents
Subagents panel
Click an agent in the roster to open its conversation. Inside the panel, click another agent or use ↑/↓ to switch. Click Esc at the top right, or press Escape, to close.
Mouse controls use Pi's fullscreen mode. /subagents and the keyboard controls also work without it. The input box messages the selected agent directly.
Tools
| Tool | Purpose |
|---|---|
spawn_subagent |
Create a named agent with its own system prompt, initial task, model, and session. |
send_message |
Send a message to one or more agents, including parents, children, and peers. |
list_subagents, subagent_history |
Inspect agent state and conversations. |
set_subagent_model, set_status |
Change model or thinking level; report progress and ETA. |
pause_subagents, resume_subagents, kill_subagents |
Control owned agents and their descendants. |
/subagents opens the panel. /subagents-pause, /subagents-resume, and /subagents-kill control named subtrees; omit names to target your direct children.
All tool results in the main session and subagents include start/finish timestamps, giving agents a sense of elapsed time for progress updates and ETA estimates. If a start time is unavailable, only the finish time is shown.
Configuration
Optional file: ~/.pi/agent/actor-subagents/settings.json (inside Pi's configured agent directory):
{
"maxAgents": 8,
"maxSpawnDepth": 3,
"childExtensions": [
"~/.pi/agent/npm/node_modules/pi-infinite-context/extensions/infinite-context/index.ts"
],
"childExtensionStatusKeys": ["bash-async"]
}
maxAgents: maximum live background agents (default:8).maxSpawnDepth: maximum hierarchy depth (default:3). Both limits must be positive integers; missing or invalid values use their defaults. Changes apply after restarting Pi.childExtensions: extension whitelist for subagents (default:[]). List extension files or directories; children do not inherit Pi's discovered extensions. A listed extension's prompt guidelines reach subagents too, because a subagent's instructions are appended to Pi's own system prompt. Actor-subagents' orchestration tools are always available and need no whitelist entry. Changes apply to newly spawned agents. The example path assumespi install npm:pi-infinite-contextin the default Pi setup. Child extensions run unattended, withctx.mode === "print"andctx.hasUI === false, so they take their headless paths instead of asking. Theirctx.ui.setStatustexts still appear in the roster and inlist_subagentswhen they set them unconditionally, not only whenctx.hasUIis true.childExtensionStatusKeys: status keys shown in the roster and inlist_subagentsof subagents (default: unset, which shows every key). Statuses with other keys are ignored. An invalid value shows every key. Changes apply to newly spawned agents.
Coordination
- Backbrief: for each task from its parent, a child is instructed to investigate briefly without changing anything, then send its parent the goal and done-criteria in its own words, numbered assumptions, a plan, the main risk and open questions, and wait for a
send_messagego-ahead before working. Stated assumptions surface gaps that questions alone miss: the parent recognizes a wrong assumption more easily than it recalls what it forgot to say. The parent can waive it in the task. This is an agent protocol, not an enforced scheduling barrier. - Ownership: every agent controls the agents it spawns and their descendants; messaging and inspection are open to all.
set_statusis for background agents. - Errors: a new child error sends its live direct parent a scheduler message: it requests a turn when idle, steers a busy parent, and buffers while the parent is paused or still stopping. It does not restart the child. Pause, resume and kill notices stay silent.
- Persistence: reopening the same saved main session restores agents paused; resume them explicitly. Buffered messages, progress, and ETA are not saved.