@kvidzibo/pi-delegate0.50.0
Delegate coding tasks to Pi workers through the native Pi extension
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-delegate
Delegate focused coding tasks to separate Pi workers through the native Pi extension. Supports local and hosted models, background jobs, and one shared local worker across participating processes.
One child per call; no nested delegation. The starter roles are:
| Kind | Purpose |
|---|---|
recon |
Find files, map code, gather facts |
implement |
Implement scoped changes and run tests |
review |
Read-only review with shell access |
oracle |
Last-resort analysis without editing |
Add roles or change prompts, models and tool access in /pi-delegate roles or ~/.pi/agent/delegate.json. Upgrading from an older version? See the migration notes.
Install
Requires Node.js 22.19+, Pi 1.5.0+ on PATH and configured model access. Choose one installation source:
pi install npm:@kvidzibo/pi-delegate
# Or a local checkout:
(cd /absolute/path/to/pi-delegate && npm ci --omit=peer)
pi install /absolute/path/to/pi-delegate
Pi supplies peer dependencies and installs runtime dependencies for npm/git sources. Local checkouts need the npm ci step above. Do not also add delegate to Pi's extensions setting. Published releases may lag behind this checkout.
Use
Ask Pi:
Delegate a background recon to find this repo's test files and test commands.
Do not edit files.
Every delegate runs in the background: the tool returns a job ID at once, and the result arrives later as a message that resumes the parent. The parent can ask a child to wrap up, or kill it, with delegate_stop. Esc interrupting the parent also cancels its running and queued delegates. Active jobs appear above the editor and finished results in the transcript; Ctrl+O expands them.
| Command | Purpose |
|---|---|
/pi-delegate |
Menu for everything below |
/pi-delegate roles |
Edit or add roles: enablement, model, reasoning, speed, tools, extensions, prompt and response settings |
/pi-delegate models |
Model-first picker, then reasoning |
/pi-delegate jobs |
Active and queued jobs with full tasks |
/pi-delegate summary |
Print a table of this session's delegate runs |
/pi-delegate checkpoints |
Opt-in periodic advice during main-agent work |
Settings save to ~/.pi/agent/delegate.json and affect future jobs only. Manual edits, package updates and other open sessions need /reload or a restart. Reload stops outstanding children.
Optional features, all off by default and set per role unless noted:
- Speed:
fast/ultrafastOpenAI Codex service tiers, using more plan allowance. - Response template: guide the final response.
- Issue log: the
log_an_issuetool records issues one by one, so they survive a failed or cancelled child. On forreview; add it to any role's tools. - Completion hook: run a trusted executable with the terminal result, with your permissions; its output is returned to the parent. The review-comment example drafts review comments from logged issues and says whether a re-review is needed, without publishing.
- Automatic checkpoints: a global setting, not per role. A tool-free advisor role comments on all main-agent work every 10 or 20 action rounds. It sends conversation and tool excerpts, which may contain sensitive data, to the advisor's provider. Feedback is advisory, not a review or approval gate.
See configuration and job controls for all settings and tool arguments, and the model comparison for a dated benchmark reference when choosing models.
Important constraints
- Shared local capacity requires Linux and
/usr/bin/flock. All local providers share one slot per agent directory; hosted jobs bypass it. Reload older sessions to participate. - No sandbox. Children have your system permissions; all shipped roles include shell access. Read-only roles rely on prompt policy, not write protection.
- No network isolation. Delegation leaves Pi's
PI_OFFLINEsetting unchanged; withoutPI_OFFLINE=1, startup may perform automatic networking. - Children do not inherit the parent conversation or project instructions. Extensions are disabled unless the role sets
extensions: true; skills, prompt templates and context files stay disabled. Provide a self-contained task and avoid overlapping edits to shared files. - Manually configured new roles without
toolsget all Pi tools; roles created in the menu start with no tools and no extensions. - No automatic diff or extra task context is prepared. For reviews, supply a readable diff or file paths and the scope; a review covers the full requested diff unless the task asks for a small one.
- Worker completion is not proof of task correctness. The parent must inspect and validate results.
- Archives under
~/.pi/agent/delegate/are retained indefinitely and can contain sensitive prompts, code, thinking and tool output.
Development
Run from the repository root:
npm ci --omit=peer
npm run test:unit # no Pi required; runs in CI
npm run test:examples # review-comment example; runs in CI
npm run test:load # installed Pi CLI, isolated temporary configuration
npm test # all three
Tests make no model calls. Delegation guidance ships with the extension; do not duplicate role/model policy in AGENTS.md.
See child-runtime and the implementation contract when working on those areas.