delegate
extension 1 skill
Delegate tasks to operator-approved child-Pi models with fail-closed enforcement
corecost-optimizationdelegationmulti-model
Open Settings → Add-Ons and pick delegate
Source: addons/delegate

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.

Approved-model boundary

Delegate can launch a model only when all four conditions hold:

  1. An operator marked its provider Approved in Settings → Delegate. No provider is approved by default.
  2. Its model ID matches one ordered, code-reviewed classification rule.
  3. The child pi --list-models catalog contains the exact provider/model ID.
  4. No provider or model exclusion denies it.

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.

Behaviour

Installation

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:

json
{
  "tools": {
    "additionalDefaultTools": ["delegate"]
  }
}

Usage

ts
delegate({
  prompt: "Summarize the public API and list compatibility risks.",
  files: ["src/client.ts"],
  task_category: "summarize"
})

Task categories

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.

Tool profiles

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.

Explicit model selection

ts
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.

Files

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.

Settings API

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.

Model catalogs and caching

Delegate keeps these roles separate:

  1. Runtime catalogctx.modelRegistry; capability metadata and the current model.
  2. Executable catalog — child pi --list-models; the only source of subprocess candidates.
  3. Current model — classified independently to establish the automatic tier ceiling.

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.

Failure and timeout behavior

Limitations

See REFERENCE.md for the full selection, execution, and diagnostics contract.

Skills