Delegate runs self-contained work in a fresh, ephemeral child Pi and restricts every child launch to an operator-approved model.
Requires Piclaw >=1.8.0.
Delegate can launch a model only when all four conditions hold:
pi --list-models catalog contains the exact provider/model ID.The Settings pane lists the resulting Approved delegate models. That list is the execution allowlist for automatic selection, an agent-supplied model, and fallback attempts. Agents cannot expand it through the delegate tool arguments, prompts, custom system prompts, or fallback errors. If a provider discloses a different message or response model, Delegate accepts the result only when that exact model is also approved.
pi --list-models entries establish executability.model can choose an exact member of the approved list and bypass automatic tier selection. It cannot bypass provider approval, classification, exclusions, executability, or image-capability checks.--mode json --no-session --no-extensions; Delegate parses structured messages, tool progress, usage, model, stop reason, and errors.Open Settings → Add-Ons, install Delegate, then reload Piclaw when convenient. Installing or updating the package does not activate new code until Piclaw reloads.
Delegate self-activates after reload. It may also be listed explicitly in .piclaw/config.json:
{
"tools": {
"additionalDefaultTools": ["delegate"]
}
}delegate({
prompt: "Summarize the public API and list compatibility risks.",
files: ["src/client.ts"],
task_category: "summarize"
})| Category | Automatic target | Use for |
|---|---|---|
quick |
Tier 2 | Formatting, extraction, translation, factual Q&A |
summarize |
Tier 2 | File, note, and code summaries |
code |
Tier 3 | Code generation and mechanical refactoring |
analyze |
Tier 3 | Code review, architecture analysis, debugging |
reason |
Tier 3 | Complex planning and multi-step logic |
judge |
Tier 3 | A second opinion from another family when a valid alternative exists |
The requested tier is capped at the current model's verified tier. If that tier has no eligible model, Delegate searches lower tiers. Judge mode crosses families only when an eligible alternative exists.
| Profile | Child tools |
|---|---|
read_only |
read,grep,find,ls |
standard (default) |
read,grep,find,ls,bash |
full |
read,grep,find,ls,bash,edit,write |
A discovered MCP adapter is appended only when explicitly available. A custom comma-separated list of child Pi built-ins is also accepted. A named tool must exist in the child; installed Piclaw add-on tools are not inherited automatically.
delegate({
prompt: "Review this implementation.",
task_category: "analyze",
model: "github-copilot/gpt-5.4-mini"
})The ID must appear in Settings → Delegate → Approved delegate models. Explicit selection can bypass the automatic tier choice, but it cannot use an unapproved provider, an unclassified or excluded model, a runtime-only model, or a model without the required image capability.
/workspace; symlinks cannot escape it, and non-regular files are rejected before sniffing.For a PDF or Office document, extract it with the appropriate Piclaw tool and delegate the resulting text. Convert unsupported images to PNG, JPEG, GIF, WebP, or BMP first.
The browser pane reads configuration from /agent/addons/api/delegate/config and model diagnostics from /agent/addons/api/delegate/models. Both are authenticated local Piclaw endpoints; Delegate stores no secrets.
Each discovered provider has one mutually exclusive mode: Approved or Exclude. Changing modes writes a complete partition to the persisted searchable_providers and excluded_providers fields. The legacy field name searchable_providers now stores the operator-approved provider list. A missing or empty list approves no providers.
Delegate keeps these roles separate:
ctx.modelRegistry; capability metadata and the current model.pi --list-models; the only source of subprocess candidates.Executable discovery is cached for 60 seconds. A manual Settings refresh invalidates it. Failed refreshes preserve the last known-good snapshot, expose the error, and remain stale so the next request retries automatically.
SIGTERM to SIGKILL if necessary.onUpdate while it runs.bash or external MCP services can execute capabilities outside Delegate's child-model launcher; use read_only and a restricted environment when that distinction matters.See REFERENCE.md for the full selection, execution, and diagnostics contract.
delegate