@henryqw/pi-subagent
Delegate bounded tasks to Pi workers. Direct tasks share your checkout. Isolated tasks produce candidates for checked integration.
Install
pi install npm:@henryqw/pi-subagent
If you use Billion Context for compression, set pi.subagents to false in ~/.config/billion-context/billion-context.json. If you set BILI_CONFIG_FILE, edit that file instead. Restart Pi after you change the setting.
Configure the required role profiles with /task-models. Direct tasks run in native Pi. For visible worker tabs or isolated tasks, use Herdr client and server version 0.9.3 or later.
Use
Ask a scout to trace a function and report the relevant files. Main uses delegate_task to dispatch the work. Use /subagent to inspect or recover a worker.
Print and JSON sessions receive the direct result in the tool call. Interactive and remote control sessions receive one follow-up when the workers finish. Set wait to true for an inline answer in these sessions.
Direct workers share 4,096 bytes of inline answer text per request. A short answer appears once. The result links to a private file for each oversized answer. A chain passes the complete answer to its next worker.
Use the scout, reviewer, implementer, planner, or oracle role. Main can cancel an owned workflow with mode: "cancel" and its exact id.
The delegation measurements compare parent results and report live worker usage.
Direct writes immediately affect your checkout. The extension holds the checkout until it verifies that the worker and its lease holders stopped. Use isolated mode for work that requires validation before integration.
{
"mode": "isolated",
"id": "refresh-repair",
"goal": "Repair token refresh.",
"tasks": [{
"id": "repair",
"kind": "changeset",
"role": "implementer",
"modelClass": "balanced",
"requirements": "Implement the smallest correct repair.",
"deliverable": "A committed candidate in the owned worktree.",
"dependsOn": [],
"contextFrom": [],
"checks": [{ "command": "pnpm", "args": ["test", "--", "refresh"] }]
}],
"finalChecks": [{ "command": "pnpm", "args": ["test", "--", "refresh"] }]
}
See the orchestration contract for roles, parallel tasks, cancellation, recovery, and checked integration.