Configuration is merged from JSON files, project over global:
| File | Scope |
|---|---|
~/.pi/agent/orchestra.json |
Global |
.pi/orchestra.json |
Project-local (wins) |
Missing keys fall back to the defaults below. Unknown keys are ignored. A broken file is ignored as a whole, so a typo never stops pi from starting.
{
"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,
"stallMs": 600000,
"stallAction": "notify",
"budgetAction": "stop",
"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. worker_start refuses to exceed it. |
defaultAgent |
"worker" |
Agent used when a dispatch names none. |
inheritModel |
true |
Workers inherit the coordinator's model when the agent names none. |
timeoutMs |
900000 |
Hard limit per worker. On expiry the worker is stopped and marked timeout. 0 = no limit. |
timeoutMode |
"total" |
How timeoutMs is measured: "total" from spawn, or "idle" — restarted on every worker event, so only silence that long stops it. |
keepOpen |
false |
Keep a settled worker alive so orchestra_send can hand it follow-up work. false reaps it on settle; worker_resume needs sessionMode: "session". |
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 other extensions, no interactive gates, no recursive dispatch. |
sessionMode |
"no-session" |
"session" keeps worker sessions in pi's session store so worker_resume can reopen one. |
budgetUsdPerWorker |
0 |
Cost ceiling per worker in USD (0 = off). Checked on every event; worker_start budgetUsd= overrides. |
budgetUsdPerRun |
0 |
Cost ceiling per run (0 = off). Crossing it stops live workers and refuses new ones; run_create budgetUsd= overrides. |
budgetMsPerWorker |
0 |
Wall-clock budget per worker: it is told to wrap up, then stopped after budgetGraceMs. |
budgetGraceMs |
60000 |
Time between the wrap-up request and the hard stop. |
stallMs |
600000 |
No-event interval that marks a worker stalled (0 = off). Distinct from timeoutMs. |
stallAction |
"notify" |
"abort" stops a stalled worker instead of only reporting it. |
budgetAction |
"stop" |
"ask" pauses the run at its ceiling instead of killing workers; action=budget raises it. |
retries |
0 |
Extra attempts after a failed worker, each with the previous failure in its brief. |
retryBackoffMs |
2000 |
First retry delay; doubles per attempt, capped at 5 minutes. |
workerCommand |
(auto) | Explicit pi executable for workers. Auto-detection uses the running runtime, then pi. |
widgetMaxLines |
8 |
Rows in the always-on widget before +N more · /orchestra browse (the hint row is extra). |
widgetShowSettled |
false |
Show settled/done rows in the widget instead of collapsing them into a counter. |
widget |
"auto" |
auto mounts the widget body only while work is live (a worker starting, running, waiting on a question, or orphaned) and clears it when the last one settles; always keeps it whenever there is a run; off removes the widget and the status line. /orchestra hide / /orchestra show set it per project; the project value is stored in state.json as ui.widget and wins over this key. |
staleRunHours |
12 |
A run whose workers are all terminal and whose last activity is older than this stops being the current run: a new session starts with no run, no widget, and new work creates a fresh run. 0 keeps the old behaviour (the newest run is always current). Nothing is deleted — /orchestra runs still lists it and /orchestra use <run> reopens and pins it. |
providerExtensions |
[] |
Extension files (or npm:/git: package specs) an isolated worker must load to reach its provider. Discovered from your installed packages when possible. |
stateDir |
.pi/orchestra |
Where state.json, logs/, mail/ and prompts/ live. |
agents |
{} |
Per-agent overrides of model, thinking level or tool list. |
.pi/orchestra/state.json is per directory and survives sessions, so the run you
started yesterday is still there today. It is only shown as the current run
while it can still move:
/orchestra use <run> (or o in the browser) pins a run — pinned beats everything.orphaned is not: that
process may still be alive), no task is pending/ready/running/blocked, and the
newest of run.updatedAt, the dispatches' end times and the tasks' updatedAt
is older than staleRunHours.A stale run is invisible to the widget and to runOf(), so task_create and
worker_start start a new run instead of appending to yesterday's. Everything
stays on disk: /orchestra runs, /orchestra status and action=run_list still
see it, and /orchestra reset clears the store (archiving state.json first).
.pi/orchestra/
├── .gitignore # "*" — created automatically
├── state.json # runs, tasks, dispatches, gates
├── logs/<dispatch>.jsonl
├── exports/<run>.jsonl # action=export
├── archive/<run>/ # action=archive
├── mail/<dispatch>/q_*.json, q_*.answer.json
└── prompts/<dispatch>.md # the agent system prompt passed with --append-system-prompt
Nothing outside this directory is written, except worker sessions when
sessionMode is "session".
Resolution order for a worker's model:
model passed to orchestra action=worker_startagents.<name>.model in configmodel in the agent markdown frontmatterinheritModel is truethinking resolves the same way through --thinking.
Use the same model string pi stores in defaultModel (for example
claude-sonnet-4-5). A worker receives --provider <name> --model <id>, so
add provider: next to model: when the same id exists on several providers; otherwise
the provider is taken from the coordinator's catalogue. With workerIsolation: true the worker does not load
provider extensions, so a bare model id resolves to the first configured provider that
offers it. A fully qualified provider/id is only needed when several loaded providers
share an id — and in that case it is the coordinator that needs the qualified form.
workerIsolation: true gives clean, fast workers: only built-in tools plus
orchestra_ask. If a worker needs an extension that registers a provider or a
tool (codemode, MCP, a custom provider), set "workerIsolation": false. Workers
then load your full extension stack, and interactive dialogs are auto-cancelled
because workers are headless.
The wall-clock limit is the only thing that stops a healthy worker, so raise it for overnight runs instead of letting a 15-minute default cut a file in half.
timeoutMode: "total" (default) counts from spawn.timeoutMode: "idle" restarts the clock on every event: busy workers are safe,
silent ones are stopped after timeoutMs.timeoutMs: 0 disables the limit; stallMs remains the safety net.worker_start spec="…" timeoutMs=0 timeoutMode=idle.budgetMsPerWorker is separate: it asks the worker to wrap up, then stops it.stallMs becomes the safety net once the wall-clock limit is off; "abort" stops
it, "notify" only reports ⚠ stalled.sessionMode: "session" records the pi session, so /orchestra resume <id> can
continue a worker after a crash or a killed coordinator; a live process that
outlived the coordinator shows as ⚡ orphaned and is still stoppable.retries: 1 repairs a failure automatically, with the previous error in the brief.budgetAction: "ask" pauses new dispatches at the run ceiling instead of killing
running ones; lift it with /orchestra budget <usd>.A complete overnight config:
{
"timeoutMs": 0,
"timeoutMode": "idle",
"stallMs": 3600000,
"stallAction": "notify",
"budgetUsdPerWorker": 5,
"budgetUsdPerRun": 40,
"budgetAction": "ask",
"retries": 1,
"keepOpen": true,
"sessionMode": "session"
}