@loka1/pi-orchestra0.6.0
Orchestrate pi worker agents from inside pi: runs, tasks, dispatches, wake-ups, questions and gates. No external runtime.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-orchestra
A pi extension that lets one pi session orchestrate other pi sessions — runs, tasks, worker dispatches, wake-ups, questions and gates — with no external runtime, no daemon and no socket. Every worker is a real pi process with its own context window, tools and model.
Docs: docs site · wiki · every section below links to its full page.

The always-on widget stays small; /orchestra browse is where you search, read a transcript, join a worker or stop one.
you (coordinator) worker (pi --mode rpc)
│ orchestra action=worker_start ─────────────► fresh session, own context
│ │
│ ◄────────── orchestra_ask (blocking question) ──┤
│ orchestra_answer ─────────────────────────────►│
│ ◄────────── settle wake-up + report + usage ────┤
│ orchestra_send ──────────────────────────────► │ follow-up work
Features
- Runs, tasks, dispatches. Group work into a run, split it into tasks with
deps, start one worker per task. Task readiness follows its dependencies automatically. - Real isolated workers. Each worker is
pi --mode rpcin its own process: own context window, own session log, own tools, own model and thinking level. - Wake-ups instead of polling. When a worker settles or asks a question, the coordinator is woken with its report and usage — you can end the turn and keep working;
orchestra_waitblocks instead when nothing else can proceed. - Questions and gates. A worker calls
orchestra_ask; the coordinator answers withorchestra_answer. The question shows up as a message, and a gate is recorded in state. - Steering and follow-ups.
orchestra_sendsteers a running worker mid-task, hands a settled one new work, or broadcasts one decision to every live worker at once. - Resume and repair.
worker_resumereopens a worker's own session (no context lost);worker_start retryOf=<id>starts a fresh worker with the failed attempt and its evidence in the brief. - Runs in the background. Ending the turn is the normal move: workers keep going for hours (
timeoutMode: "idle"restarts their clock on every event) and you are woken with the report. - Budgets and a stall watchdog. Cost and wall-clock ceilings per worker and per run, plus detection of a worker that stopped emitting events — distinct from the hard timeout that kills a long task.
- Searchable, measurable.
action=search(and/orchestra grep) greps every worker log,action=metricsshows cost and turns per worker with a spend timeline, andaction=export/action=reportwrite JSONL or a markdown run report. - Joinable.
/orchestra join <id>(orjin the browser) opens one worker's conversation full-screen: what you asked, what it replied, thinking and tool calls, with a composer that steers a live worker or hands a settled one follow-up work.escreturns to the browser,ctrl+gto your own session. - Reviewable. Every dispatch records the git commit it started from, so
Din the browser (oraction=diff) shows exactly what that worker changed, andaction=reportwrites a markdown run report for a PR. - Self-correcting. Dependency cycles are refused instead of deadlocking a run,
retriesre-dispatches a failed worker with the failure in the brief, and a coordinator restart tells orphaned processes (still alive) apart from lost ones — and can stop them. - Live status. A compact, width-aware widget ordered by what needs you (questions → running → failed/timeout → ready → settled), mounted only while work is live, plus
/orchestra browse: a scrollable, searchable list of tasks, workers and runs with detail, message, stop and follow actions. - Durable, local, private. One JSON state file, one JSONL log per worker, all under
.pi/orchestra/(git-ignored by the extension itself). Nothing leaves the machine except the model calls you already make. - Isolated by default. Workers start with
--no-extensionsplus this extension only: no MCP servers, no interactive permission gates, no recursion into more workers.
Install
From npm (or from git, which tracks main before a version is released):
pi install npm:@loka1/pi-orchestra
# or
pi install git:github.com/loka1/pi-orchestra
The npm package carries the repository, homepage and bugs links, so its page
points back here and at the docs site.
Every release attaches the same tarball, if you would rather pin a file:
gh release download --pattern '*.tgz' # newest release
pi install ./loka1-pi-orchestra-*.tgz
Try it without installing:
pi -e git:github.com/loka1/pi-orchestra
Reload an open session with /reload after installing.
→ Installation: install and upgrade.
Quick start
Give pi one instruction:
Create the run goal "add input validation", then three tasks: audit the API handlers,
write the validators, and update the tests (depending on the audit). Start a worker for
each ready task, then report per task as they settle, with the evidence.
Or drive it tool by tool:
orchestra action=run_create name="api-validation" goal="validate every endpoint"
orchestra action=task_create title="Audit handlers"
orchestra action=task_create title="Write validators" deps=["<audit task id>"]
orchestra action=worker_start taskId="<audit task id>"
orchestra action=worker_start spec="Review src/api for missing validation and report a list."
# end the turn here — each worker wakes you with its report when it settles
cat .pi/orchestra/logs/<dispatch id>.jsonl # or: /orchestra watch <id>
→ Commands: every command.
Concepts
| Concept | What it is |
|---|---|
| Run | A named body of work with an optional goal. State and reports are grouped per run. |
| Task | A unit of work inside a run. deps make it ready only after its dependencies are done. |
| Dispatch | One worker process working on a task (or on a free-form spec). |
| Gate | A question a worker is blocked on, answered with orchestra_answer. |
→ Workers: worker lifecycle.
Commands
Tab completes after /orchestra: the subcommand first, then the live argument
(dispatch, task, run or template ids, matched on id, status and title).
Look at the run
/orchestra the browser in TUI mode, the run summary elsewhere
/orchestra browse [query] browser pre-filtered with `query`
/orchestra status summary, task table and worker table of the active run
/orchestra runs runs, newest first (→ marks the active one)
/orchestra use <id> make a run the active one
/orchestra tasks tasks with readiness and dispatch ids
/orchestra workers workers with status, turns, tools and cost
/orchestra questions pending questions and gates
Work with one worker
/orchestra open <id> detail of a task, worker or run, with transcript tail
/orchestra read <id> compact transcript (tool calls and replies)
/orchestra join <id> joined chat: read it and type into it
/orchestra chat <id> the same conversation as plain text
/orchestra watch <id> live transcript in the widget (tail)
/orchestra unwatch stop watching
/orchestra stop <id> abort and stop a worker
/orchestra retry <id> [note] repair a failure: same spec, failure prepended
/orchestra resume <id> [msg] reopen the worker's own session
/orchestra diff <id> what it changed since it started (git diff)
/orchestra broadcast <msg> one message to every live worker
Cost, search and reports
/orchestra metrics cost and turns per worker, spend timeline, delta vs the last run
/orchestra report markdown run report → .pi/orchestra/exports/<run>.md
/orchestra export [json] the run's cost/turn timeline → .pi/orchestra/exports/
/orchestra budget [usd] show spend, or raise the run's cost ceiling
/orchestra grep <text> search every worker transcript
/orchestra find <query> filter tasks, workers and runs
Setup and upkeep
/orchestra templates list run templates
/orchestra template <name> create a run from a template
/orchestra config state dir, config sources, effective config
/orchestra hide hide the widget and status line in this project
/orchestra show [mode] bring them back (`auto`, `always`, `off`)
/orchestra reset archive this project's state and start clean
/orchestra archive [keep] move finished runs to .pi/orchestra/archive/
/orchestra prune [days] delete archived runs and orphaned files older than N days
/orchestra back leave a joined chat (inside it: /back, /exit)
→ Commands: complete command and action reference.
Tools
| Tool | Purpose |
|---|---|
orchestra |
Control plane: one action per call (listed below). |
orchestra_wait |
Block until a dispatch (or every live worker) settles, a question arrives, or the timeout fires. |
orchestra_send |
Steer a running worker, give a settled one follow-up work, or dispatch="*" to message every live worker. |
orchestra_answer |
Answer a blocking question; the worker resumes as soon as it is written. |
orchestra_ask |
Worker side only. Ask the coordinator and block until it answers. |
orchestra actions, by area:
runs run_create, run_list, run_use
tasks task_create, task_list, task_update
workers worker_start, worker_resume, worker_list, worker_show, worker_read,
worker_stop, worker_keep_open, worker_send
flow wait, answer, gate_list
inspect status, search, chat, diff, metrics, report, export
upkeep budget, prune, archive, templates, reset
Browsing
A widget cannot take keyboard focus, so the interactive surface is /orchestra
(or /orchestra browse), which opens a full-screen list in TUI mode. Print and
RPC modes get the same content as text.
Navigation
| Key | Action |
|---|---|
↑ ↓ |
move one row |
PgUp PgDn / ctrl+d ctrl+u |
page / half page |
home end / g G |
first and last row |
tab |
switch scope: tasks → workers → runs |
/, then type |
search over title, id, agent, meta and status (field terms below) |
enter |
detail: metadata, report and transcript tail |
esc |
clear the search, then close |
q |
close |
Actions
| Key | Action |
|---|---|
space |
mark the row (▣); x, r and c then apply to every mark |
x / r |
stop / retry the highlighted worker, or every marked one |
m |
message the worker (opens the editor) |
c |
put the marked (or current) dispatch ids in the editor |
j |
join the worker's chat |
d |
full transcript, tail-following |
D |
diff of what the worker changed since it started |
f |
follow the worker in the widget |
o |
make the highlighted run the active one |
s / t |
sort by cost / by time (default: urgency) |
Search understands fields, not just words: status:failed, agent:reviewer,
kind:worker, run:ab12, cost:>0.1, turns:>=8, combined with free text
(status:failed port backend). The same syntax works in task_list/worker_list
filter and in the non-TUI /orchestra find.
The detail pane scrolls, and its transcript tails live: opening a log pager
starts at the end and keeps following (f toggles inside the pager, scrolling
pins it).
Rows are sorted by urgency by default, so a worker waiting on a question is
always the first thing on screen; s and t re-sort by spend and recency.
Status comes from the dispatch whenever one exists: a task whose worker settled
never shows a failure glyph, and a timeout keeps its ⏱ n m marker.
The always-on widget is deliberately small: it renders the top
widgetMaxLines rows plus +N more · /orchestra browse, and collapses settled
tasks into a counter unless widgetShowSettled is on.
Keeping the widget quiet
The widget body only costs viewport space while it earns it. With the default
widget: "auto", it mounts while workers are starting, running, waiting on a
question or orphaned, and disappears once the last one settles — the one-line
status bar stays, so 3 done · 1 question is still visible. /orchestra hide
turns both off for this project (persisted in state.json, so a new session in
the same directory stays quiet); /orchestra show brings them back, and
/orchestra show always pins the widget on even when nothing is running.
.pi/orchestra/state.json is per directory and outlives sessions on purpose, so
a finished run does not vanish from /orchestra runs. It does stop being
current: once nothing in it has moved for staleRunHours (12 by default) the
next session starts with no run and no widget instead of yesterday's screen.
Nothing is deleted — /orchestra use <run> reopens it and pins it, and
/orchestra reset archives the whole store and starts from zero.
→ Browsing: keys, detail view, bulk actions.
Joining a worker
/orchestra join <dispatch> (or j in the browser) replaces the screen with
that worker's conversation:
⤷ joined 9c4e7a10bd · worker · running
● running 3m · 4 turns · 12 tools · $0.07 of $2.00
anthropic/claude-sonnet-4-5 · live
▶ you
Port the JSONL backend, keep the header format.
◆ worker
Reading the store first, then the header codec.
→ read src/store.ts
export interface Store { … }
→ bash npm test -- jsonl
42 passing
────────────────────────────────────────────────────────────
message this worker — /help for commands
enter send · ctrl+e editor · ctrl+t think · ctrl+o tools · ctrl+g main · esc orchestra
Typing sends to that worker, not to the coordinator: a running worker gets a
steer (delivered after its current tool call), a settled one with keepOpen
gets a follow-up turn in its own context. Composer commands: /stop, /retry,
/resume, /diff, /open and /back (return to the list), /exit (your own
session), /help; ctrl+e opens the full editor for a long message.
esc clears a draft, then goes back to the browser; ctrl+g returns to your own
session. Joining is a view: it changes nothing about the worker, its task or the
run, and the budget and stall watchdog keep running.
→ Browsing: joining, keys, leaving.
Working while workers run
Workers are background processes, so the coordinator does not have to sit and wait:
you ▸ port the storage layer with two workers, then review their diffs
pi ▸ orchestra action=worker_start spec="…storage interface…"
▸ orchestra action=worker_start spec="…jsonl backend…"
Started dispatch_9c4e7a10bd and dispatch_ab12cd34ef.
End your turn — you will be woken when they settle.
After starting, ending the turn is the normal move: the extension wakes the
coordinator (as a follow-up turn) when a worker settles, and immediately when one
asks a question. You can chat about something else in the meantime, or work in a
different session — the run lives in .pi/orchestra/, not in the conversation.
Use orchestra_wait timeoutMs=… only when nothing else can proceed, e.g. before
a step that needs the result. wait also returns when a worker asks a question,
so one call covers both.
For jobs that outlive a normal working session, raise the ceiling instead of the model being killed mid-file:
{ "timeoutMs": 21600000, "timeoutMode": "idle", "stallMs": 1800000, "stallAction": "abort" }
timeoutMode: "idle" restarts the clock on every event: a worker that is reading,
editing and running commands is never stopped, while silence for timeoutMs
(e.g. 6 h) is. timeoutMs: 0 removes the wall-clock limit entirely and leaves the
stall watchdog (stallMs) as the only safety net. Both can be set for one
dispatch: worker_start spec="…" timeoutMs=0.
Running overnight
The settings that matter when nobody is watching, in ~/.pi/agent/orchestra.json:
{
"timeoutMs": 0,
"timeoutMode": "idle",
"stallMs": 3600000,
"stallAction": "notify",
"budgetUsdPerWorker": 5,
"budgetUsdPerRun": 40,
"budgetAction": "ask",
"retries": 1,
"keepOpen": true,
"sessionMode": "session"
}
timeoutMs: 0(or a large idle value) means a long task is never cut in half.stallMsis then the safety net: an hour with no event is reported in the widget and in/orchestra status;stallAction: "abort"also stops it.- Cost ceilings still apply —
budgetAction: "ask"pauses new dispatches at the run ceiling instead of killing the ones that are running. sessionMode: "session"records each worker's pi session, so a crash or a killed coordinator can be recovered with/orchestra resume <id>instead of redoing the task. A live process that outlived the coordinator shows as⚡ orphanedand can still be stopped or resumed.retries: 1repairs a failure automatically before you wake up; the retry prompt carries the old error.
→ Workers: background work and long jobs.
Budgets, stalls and repair
A worker can be expensive or quiet without being stuck, and neither is caught by
timeoutMs alone.
{
"budgetUsdPerWorker": 2,
"budgetUsdPerRun": 10,
"budgetMsPerWorker": 1200000,
"budgetGraceMs": 60000,
"stallMs": 600000,
"stallAction": "notify"
}
- Cost budget is checked on every event a worker emits. Crossing it (or the
run ceiling) stops the worker, marks it
failedwith astopNote, and refuses new workers until the run is archived or the ceiling raised.run_create budgetUsd=andworker_start budgetUsd=/budgetMs=override the defaults. - Wall-clock budget is not a kill switch: at
budgetMsPerWorkerthe worker is told to wrap up, and only afterbudgetGraceMsis it stopped. - Stall watchdog flags any live worker with no events for
stallMs, shows it as⚠ stalled 12min the widget, and sends a message.stallAction: "abort"stops it instead.
budgetAction: "ask" turns the ceiling into a checkpoint rather than a kill
switch: live workers finish their step, nothing new starts, the run shows
⏸ budget paused, and orchestra action=budget usd=<n> (or /orchestra budget)
raises it and reopens the gate.
retries (and worker_start retries=) re-dispatch a failed worker on its own,
with exponential backoff; a repair dispatch keeps attempt, so the policy stops
after the budget and never retries a deliberate kill (stopped, budget, stall).
Processes that survive a coordinator restart become ⚡ orphaned instead of
lost: their pid can still be stopped with worker_stop, and worker_resume
continues from the stored session.
When a worker fails, worker_start retryOf=<dispatch> starts a repair attempt:
it reuses the spec, agent, tools and model, and leads the prompt with the
previous status, error, last tool and report so the new worker checks the tree
before redoing anything. With sessionMode: "session",
worker_resume dispatch=<id> goes further and reopens the same session, so
nothing the worker learned is lost.
→ Configuration: every setting and default.
Dependencies, retention and cleanup
task_create deps= and task_update deps= refuse a dependency loop and print
the path (A -> C -> B -> A), so a typo cannot silently deadlock a run; a cycle
that is already on disk is shown as ⊘ blocked with that note until the graph is
fixed. orchestra action=prune days=<n> dryRun=<bool> (or /orchestra prune 30)
deletes archived run directories and orphaned logs/prompts/mail/exports older
than the window — live state is never touched.
→ Configuration: every setting and default.
Broadcasting, search and redaction
orchestra_send dispatch="*" (or /orchestra broadcast <msg>) delivers one
message to every live worker and reports per-worker success — the cheap way to
land a decision that affects three parallel workers.
orchestra action=search filter=… greps every .pi/orchestra/logs/*.jsonl
(tokens are ANDed), returning dispatch, line number and redacted text;
/orchestra grep <text> prints the same. Secrets never reach the logs in the
first place: API keys, tokens, JWTs and password=-style assignments are
redacted before a line is appended.
→ Commands: actions and filters.
Metrics and export
orchestra action=metrics prints the per-worker table, totals, a spend
sparkline and — when a run with the same template or name exists — a delta line
(vs previous squad: +$0.15 cost · +3 turns …); the run detail pane in the browser shows the same
under Cost & turns. orchestra action=export (or /orchestra export [json])
writes .pi/orchestra/exports/<runId>.jsonl: one run header line, one worker
line per dispatch (turns, tools, tokens, cost, duration) and one point per
timeline event with cumulative cost and turns.
orchestra action=report turns the same numbers into a markdown report —
goal, task table, each worker's report, failures, diff stats and the cost
regression — and writes it to .pi/orchestra/exports/<runId>.md. That is the
file to paste into a PR.
→ Commands: metrics, export, report.
Templates
A run usually starts with the same shape: implement, then review; or split a
migration across three workers. Put that shape in
.pi/orchestra/templates/<name>.md (or ~/.pi/agent/orchestra/templates/) and
create the whole run in one call.
# Review squad
goal: Land a change, then have an independent reviewer check it.
agent: worker
## Implement the change
spec: Implement the task, run the project's checks, report files and evidence.
## Review the change
deps: Implement the change
agent: reviewer
/orchestra template review-squad # or: orchestra action=run_create template=review-squad
A ## Heading is a task title; spec:, agent:, model:, thinking: and
deps: come from its first lines (deps name earlier task titles), everything
else becomes the spec. A template with no tasks is ignored, and a missing
dependency fails with the task that asked for it. config/templates/ ships a
ready-made review-squad.md.
→ Configuration: templates and config.
Configuration
Merged from JSON files (project wins over global):
| File | Scope |
|---|---|
~/.pi/agent/orchestra.json |
Global |
.pi/orchestra.json |
Project-local |
{
"maxConcurrency": 4,
"defaultAgent": "worker",
"inheritModel": true,
"timeoutMs": 900000,
"timeoutMode": "total",
"keepOpen": false,
"notifyOnSettle": true,
"workerIsolation": true,
"widgetMaxLines": 8,
"widgetShowSettled": false,
"widget": "auto",
"staleRunHours": 12,
"providerExtensions": [],
"sessionMode": "no-session",
"budgetUsdPerWorker": 0,
"budgetUsdPerRun": 0,
"budgetMsPerWorker": 0,
"budgetGraceMs": 60000,
"budgetAction": "stop",
"stallMs": 600000,
"stallAction": "notify",
"retries": 0,
"retryBackoffMs": 2000,
"agents": {
"reviewer": { "model": "claude-sonnet-4-5", "thinking": "high", "tools": ["read", "grep", "ls"] }
}
}
| Key | Default | Meaning |
|---|---|---|
maxConcurrency |
4 |
Maximum simultaneously running workers. |
defaultAgent |
"worker" |
Agent used when a dispatch names none. |
inheritModel |
true |
Workers inherit the coordinator's model when the agent names none. |
providerExtensions |
[] |
Extra extension files (or npm:/git: specs) an isolated worker should load, typically a provider package. Usually discovered automatically. |
timeoutMs |
900000 |
Hard limit per worker; it is stopped (and marked timeout) after this. 0 disables it; overridable per dispatch with worker_start timeoutMs=. |
timeoutMode |
"total" |
How timeoutMs is measured. "idle" restarts the clock on every worker event, so only silence that long stops it — use it for multi-hour jobs. |
keepOpen |
false |
Keep a settled worker's process alive so orchestra_send can hand it follow-up work. false reaps it on settle; the error then points at worker_resume (needs sessionMode: "session") or a fresh dispatch. |
notifyOnSettle |
true |
Wake the coordinator when a worker settles or asks a question. |
workerIsolation |
true |
Start workers with --no-extensions -e <this extension> (no MCP, no interactive gates). |
sessionMode |
"no-session" |
"session" keeps worker sessions on disk so worker_resume can reopen one. |
budgetUsdPerWorker |
0 |
Cost ceiling per worker in USD (0 = off). Overridable per dispatch. |
budgetUsdPerRun |
0 |
Cost ceiling per run (0 = off). Overridable with run_create budgetUsd=. |
budgetMsPerWorker |
0 |
Wall-clock budget per worker; wrap-up first, then stop after budgetGraceMs. |
budgetGraceMs |
60000 |
Grace period between "wrap up" and the hard stop. |
stallMs |
600000 |
No-event interval that counts as stalled (0 = off). |
stallAction |
"notify" |
"abort" stops a stalled worker instead of only reporting it. |
budgetAction |
"stop" |
"ask" pauses the run at the ceiling instead of stopping workers; raise it with action=budget. |
retries |
0 |
Extra attempts after a failed worker (each one gets the failure in its brief). |
retryBackoffMs |
2000 |
Wait before the first retry; doubles per attempt, capped at 5 minutes. |
workerCommand |
(auto) | Override the pi executable used for workers. |
stateDir |
.pi/orchestra |
Where state, logs and prompts live. |
widgetMaxLines |
8 |
Rows in the always-on widget before +N more (hint row excluded). |
widgetShowSettled |
false |
Show settled rows instead of collapsing them into a counter. |
widget |
"auto" |
auto mounts the widget only while work is live, always keeps it whenever there is a run, off removes widget and status line. `/orchestra hide |
staleRunHours |
12 |
A finished run older than this stops being the current run in a new session (0 = never). It stays in /orchestra runs. |
agents |
{} |
Per-agent overrides of model/thinking/tools. |
Which model does a worker run?
A worker gets an explicit {provider, id} pair, never a bare slash id: pi splits
provider/id out of --model, so a model whose real id is acme/fast-1 has to be
passed as --provider acme --model acme/fast-1, otherwise pi looks for fast-1 on
the acme provider and quietly lands on a different model.
provider/modelgiven toworker_start, else- the agent's frontmatter (
provider:,model:) or itsagents.<name>override, else - the coordinator's model (
inheritModel).
The provider is resolved from the model id against the coordinator's catalogue
(preferring the coordinator's own provider when an id exists on several). Because
workerIsolation starts the worker with --no-extensions, provider extensions have to
be loaded explicitly: orchestration finds the installed package that registers that
provider (from your pi packages) and passes it with -e. Nothing extra needs to be
installed or configured — providerExtensions exists for the cases discovery cannot see.
Before spawning, a throwaway pi … --list-models <provider>/<id> confirms the worker
really has that model. If it does not, the worker falls back to the coordinator's
model and modelNote says so; if that is unavailable too, the dispatch is marked with a
warning instead of silently running something else. worker_start, worker_show,
worker_read and the browser all print (provider) model.
→ Configuration: every setting and default.
Agents
Workers use the same agent definitions as pi's bundled subagent example — markdown with YAML frontmatter. name and description are required; tools, model, provider and thinking are optional and fall back to the config and the coordinator:
---
name: reviewer
description: Read-only code review
tools: read, grep, find, ls, bash
model: claude-sonnet-4-5 # or provider/model, see below
thinking: high
---
You review code and report findings ordered by severity. You do not edit files.
Locations: ~/.pi/agent/agents/*.md (user) and .pi/agents/*.md (project, overrides by name). The system prompt is appended to the worker's prompt with --append-system-prompt, so workers keep pi's full tool behaviour.
→ Configuration: agent files and overrides.
How it works
worker_startcreates a dispatch in.pi/orchestra/state.json, writes the agent prompt to.pi/orchestra/prompts/<id>.md, and spawnspi --mode rpc --no-session --no-extensions -e orchestra.ts [--model …] [--thinking …] [--tools …](--session-idinstead of--no-sessionwhensessionMode: "session").- The worker gets a preamble with its task and the
orchestra_asktool. It works autonomously. - Its stdout events are appended to
.pi/orchestra/logs/<id>.jsonl; the coordinator tracks turns, tool calls, tokens and cost from them. - On
agent_settledthe coordinator records the final text, closes the task, refreshes dependents and wakes you with a report. - Questions travel as files under
.pi/orchestra/mail/<dispatch>/: the worker blocks onorchestra_ask, the coordinator polls once a second, surfaces the question, andorchestra_answerwrites the answer file that unblocks it. - On session shutdown the workers this session started are aborted and stopped (SIGTERM, then SIGKILL after five seconds). A process that survives a crash is rebuilt on load as
orphaned(live pid, still stoppable and resumable) orlost(pid gone) — a dispatch is authoritative for what actually happened.
No ports, no daemon, no external state store. The only requirement is a working pi on PATH (or workerCommand).
→ Workers: processes, state and logs.
Safety
- Workers share your working directory and filesystem. They can edit what you let their tools edit; use agent
toolsto restrict them. - Project agents (
.pi/agents/) are repo-controlled prompts. Only use them in repositories you trust. workerIsolationstarts workers with only built-in tools and this extension, which also means provider plugins loaded as extensions are not available inside workers. Set"workerIsolation": falseif a worker needs your full extension stack.- A worker dialog (confirm/select) is auto-cancelled because workers are headless; prefer isolated workers or non-interactive extensions.
→ Workers: isolation and prompts.
Documentation
The pages live in wiki/ and are published to two places on every change:
- Docs site — https://loka1.github.io/pi-orchestra/ (GitHub Pages, built by the
Docs siteworkflow fromscripts/wiki-site.mjs) - GitHub wiki — https://github.com/loka1/pi-orchestra/wiki (mirrored there by the
Sync wikiworkflow)
| Page | What it covers |
|---|---|
| Installation | install, upgrade, requirements |
| Configuration | every setting, defaults, agents, long jobs |
| Commands | /orchestra, the tools, actions and filters |
| Browsing | the list, detail view, joining a worker |
| Workers | processes, lifecycle, background work, isolation |
README.md stays the overview; the wiki pages are the reference.
Limitations
- One coordinator per state directory. Two pi sessions sharing
.pi/orchestra/would fight overstate.json. - A worker whose process died while the coordinator was down is marked
lost; a process that outlived the coordinator isorphaned— still alive, stoppable and resumable. - No git-worktree isolation yet: workers run in the coordinator's cwd.
- Worker usage is reported in its dispatch, but is not added to the coordinator's own cost totals.
More pi packages
Focused, single-purpose extensions from the same author. Each installs on its own:
| Package | What it does |
|---|---|
| pi-orchestra — this package | Orchestrate worker agents from one session: runs, tasks, dispatches, questions and gates.pi install npm:@loka1/pi-orchestra |
| pi-auto-compact | Auto-compact the context at a configurable % used, globally or per model, with a status-bar indicator.pi install npm:@loka1/pi-auto-compact |
Browse all pi packages: https://github.com/loka1?tab=repositories&q=pi-&type=source
License
MIT