Pi and subagents
Patchmill sets PI_CODING_AGENT_DIR to .patchmill/pi-agent/ for its Pi
processes, giving them an isolated agent directory. Configure the Pi sessions
started by Patchmill in:
Keep this machine-specific runtime state local. Do not commit
.patchmill/pi-agent/ with repository configuration or project-local skills.
Authenticate the required providers
Section titled “Authenticate the required providers”Run Patchmill’s repository-local authentication flow before editing model settings:
Run it once for each provider referenced by the orchestrator or a subagent
override. For a mixed-provider setup, authenticate each provider and choose the
intended orchestrator model on the final run. patchmill auth updates
defaultProvider and defaultModel while preserving unrelated settings in the
same JSON object.
Configure the orchestrator and subagents
Section titled “Configure the orchestrator and subagents”The following example uses a balanced orchestrator, a fast scout, a coding-focused worker, and an independent high-capability reviewer:
These model IDs are concrete examples, not permanent recommendations. Provider catalogs change. Use models available to your Patchmill runtime that fit the same role characteristics.
| Role | Workload | Configuration goal |
|---|---|---|
| Main orchestrator | Coordinates the Patchmill run and synthesizes results | Balance reasoning quality, latency, and cost |
scout |
Finds files and maps repository structure | Prefer fast, inexpensive exploration |
worker |
Implements production changes | Prefer a strong coding model with deeper reasoning |
reviewer |
Performs adversarial correctness review | Prefer an independent, high-capability review model |
Understand the settings
Section titled “Understand the settings”defaultProvideranddefaultModelselect the main Patchmill orchestrator model.defaultThinkingLevelsets the orchestrator’s default thinking level.subagents.agentOverrides.<role>.modelselects a provider-qualified subagent model such asopenai-codex/gpt-5.4.subagents.agentOverrides.<role>.thinkingsets that role’s thinking level.
Pi recognizes off, minimal, low, medium, high, xhigh, and max for
the main runtime. For an explicit subagent role override, use minimal, low,
medium, high, xhigh, or max; off lets the child use its default
thinking level instead. Choose a level supported by the selected provider and
model.
Verify the configuration
Section titled “Verify the configuration”After changing authentication or settings, run:
doctor validates the main Pi runtime and lists the resources Patchmill will
load. A configured child provider and model are fully exercised only when that
subagent runs.
If a role fails to start:
- For an unknown model ID, choose an available model and correct that role’s
provider-qualified
modelvalue. - For missing provider authentication, rerun
patchmill authfor that provider. - For an unsupported thinking level, use one of the documented values supported by the model.
- Repair the affected role override instead of deleting all overrides and unintentionally making every role use the orchestrator model.
For settings beyond Patchmill’s needs, see the upstream
Pi settings reference
and
pi-subagents builtin override documentation.