- Avoid native supervisor-channel tool conflicts when
pi-intercomis also installed by deferring native tool registration until runtime startup and keeping a namespaced native supervisor reply tool.
- Added optional
toolBudgetlimits for child subagent tool calls. Runs, steps, and agents can set{ soft?, hard, block? }; the child runtime nudges at the soft limit and blocks configured tools after the hard limit so runaway browsing can still finish with final text. - Added a stable v1 in-process event-bus RPC for other Pi extensions, with
ping,status, async-onlyspawn,interrupt, and asyncstopover versioned request/reply envelopes. - Added
toolDescriptionModewithfull,compact, andcustommodes for the parent-facingsubagenttool description. Compact mode reduces prompt bloat while keeping safety-critical orchestration guidance, and invalid custom descriptions fall back to full mode. - Added an optional read-only subagent fleet/status view with
/subagents-fleetandsubagent({ action: "status", view: "fleet" }), plusview: "transcript"to tail active async child output/session artifacts. - Added uniform per-child transcript artifacts (
<run>_<agent>_transcript.jsonl) for foreground and async subagent runs, gated bysubagents.artifacts.includeTranscript(default on). Each transcript is a versioned JSONL stream of child messages, tool starts/ends, and stdout/stderr lines with a byte cap and truncation marker. - Added
subagent({ action: "steer", id, message, index? })for non-terminal guidance to live async Pi child sessions, with file-backed control requests, per-child steering inboxes, status/event visibility, and queued delivery for pending indexed async children when the runtime supports mid-run steering. - Added an optional
turnBudget(maxTurnswithgraceTurns) for foreground and async/background subagent runs. At the softmaxTurnslimit the child is warned via its system prompt to wrap up; aftergraceTurnsadditional assistant turns the run is aborted and partial output is returned.turnBudget,turnBudgetExceeded, andwrapUpRequestedpropagate through results, async status, and nested summaries. - Added optional scheduled subagent runs so callers can defer a subagent launch until a future time.
subagent({ action: "schedule", agent, task?, schedule: "+10m" | "2030-01-01T09:00:00Z", scheduleName? })arms a one-shot timer that launches the run as a normal tracked async run once it fires, withschedule-list,schedule-status, andschedule-cancelmanagement actions. Schedules are persisted per session and restored after a Pi restart; jobs missed by more than the configured lateness window are markedmissedinstead of firing late. The feature is opt-in and requires{ "scheduledRuns": { "enabled": true } }in~/.pi/agent/extensions/subagent/config.json. Only schedule explicit delayed runs the user asked for. Thanks to @tintinweb for the concept. - Added a real Pi-session E2E test lane with faux provider routing to verify parent-child subagent result delivery without network model calls.
- Hardened the
waittool's wake path so an event wake cancels its poll-interval fallback timer instead of letting both run, and so an already-aborted turn resolves immediately. Added a test that verifies an event wakeswaitbefore the poll interval elapses. - Added smart completion batching for async subagent notifications. Successful sibling completions that finish within a short window now arrive as a single grouped message instead of separate notifications; a hard max-wait cap prevents holding them indefinitely, and late-finishing siblings join a shorter straggler group. Failed and paused completions bypass batching and fire immediately so failure and attention signals are never delayed. The debounce window, max-wait cap, and straggler windows are configurable via
completionBatchinconfig.json. - Added
subagent({ action: "eject" }),disable,enable, andresetmanagement actions for bundled and custom agents.ejectcopies a builtin or package agent to user/project scope as an editable custom file that shadows the original;disable/enabletoggle a reversibleagentOverrides.<name>.disabledsettings override without deleting the agent;resetremoves the scope's custom agent file and/or settings override to restore the bundled default. All four acceptagentScope: "user" | "project"(defaultuser) and are blocked from child-safe fanout mode alongsidecreate/update/delete. - Added fuzzy model resolution so callers can specify models with provider separator variations, optional date-stamp parts, and case differences instead of exact
provider/modelIdstrings. Whensubagents.modelScope: { enforce: true, allow: [...] }is configured, explicit caller-supplied out-of-scope models error while frontmatter/parent-inherited/fallback models warn. Inspired by @tintinweb's pi-subagents. - Added a parent-side
waittool for detached async subagent runs.wait()returns when the next active run finishes or needs attention,wait({ all: true })drains all active runs,wait({ id })targets one run, andwait({ timeoutMs })caps the block. This lets background-launching skills and non-interactivepi -pruns keep going without sleep/status-polling loops or abandoned children. Thanks to RoboBryce (@robobryce) for #365. - Added an opt-in
memoryfrontmatter field for agent definitions so recurring custom agents can maintain role-specific durable memory (e.g. a security reviewer accumulating threat-model notes).memory: { scope: "project" | "user", path: "<name>" }resolves a safeagent-memory/directory, injects the first 200 lines of aMEMORY.mdinto the child system prompt, and falls back to a read-only memory block for agents without write tools. Memory lives under a dedicated namespace that does not conflict with Pi's parent/session/project memory system. Inspired by @tintinweb's pi-subagents. - Added native supervisor coordination for child subagents. Children can use
contact_supervisorwithout installingpi-intercom, and parent-side requests are scoped to the exact session id that spawned the child. - Added native prompt workflow commands:
/prompt-workflowruns a prompt template through a subagent, and/chain-promptsturns prompt templates into native subagent chain steps.
- Let foreground sequential chain tool calls launch directly when
clarifyis omitted; useclarify: trueto opt into the clarify UI. Addresses #385. - Tolerate execution-mode action aliases such as
single,parallel,PARALLEL, andtaskswhen the matching execution fields are present, while preserving clear runtime errors for unknown management actions, addressing #382. - Removed companion-package recommendation messages from session start,
subagent({ action: "list" }), and/subagents-doctor, addressing #381. - Scope async subagent completion notifications to the exact owning Pi session so another session in the same repo no longer receives result notices.
- Harden scheduled-run timestamp parsing and persisted store validation so ambiguous absolute times and corrupted job records fail clearly instead of being normalized or dropped.
- Derive live-detail and full-notification hints from Pi's configured expand key instead of hard-coding
Ctrl+O. Thanks to Kylegl (@kylegl) for #364. - Tolerate transient Windows
EPERM/EBUSY/EACCESlocks when atomically replacing async JSON files. Thanks to ThanhNT29Jacky (@ThanhNT29Jacky) for #380. - Hardened the async timeout integration test to wait for the mock child to spawn before asserting the timeout result, fixing a race where the timeout could fire before the child existed.
- Added
subagents.defaultModelso subagents can have a global default model separate from the parent session model. Thanks to Artem Timofeev (@atimofeev) for #339. - Added
/subagent-costandtotalChildUsagerun details so parent sessions can inspect aggregate subagent child usage and cost. Thanks to Aaron Ky-Riesenbach (@aaronkyriesenbach) for #343. - Added configurable companion package recommendations for
pi-intercomandpi-prompt-template-model, surfaced in session-start transcript messages,subagent({ action: "list" }), and/subagents-doctor, with/subagents-companionshide/show/status controls. Removed again in the next release after #381 because context-visible package recommendations were too noisy. - Added detached async runner stdout and stderr log files. Thanks to Daniel Mateos Carballares (@danim47c) for #358.
- Added
totalCostrollups to foreground single, parallel, and chain run details, including nested foreground subagent costs and compact progress display. Thanks to Clark Everson (@gr3enarr0w) for #345. - Added
globalConcurrencyLimitto cap simultaneously running subagent tasks across parallel groups in a single run. Thanks to Clark Everson (@gr3enarr0w) for #349. - Added stable v1 async lifecycle artifact metadata in
status.json,events.jsonl, and result JSON so observability and workflow gates can correlate subagent runs without scraping terminal output. Thanks to Clark Everson (@gr3enarr0w) for #350. - Added
PI_SUBAGENT_PI_BINARYto let wrappers launch child agents through an explicit Pi binary instead of resolvingpifromPATH. Thanks to David Barroso (@dbarrosop) for #341. - Added
worktreeBaseDirandPI_SUBAGENTS_WORKTREE_DIRso worktree isolation can use a stable trusted base directory. Thanks to Matt Robenolt (@mattrobenolt) for #185. - Added
singleRunOutputBaseDirso single-agent relative outputs can be routed to a configured artifact directory. Thanks to Oleksii Nikiforov (@NikiforovAll) for #173. - Added
maxSubagentSpawnsPerSessionandPI_SUBAGENT_MAX_SPAWNS_PER_SESSIONto cap total subagent launches in one session. Thanks to @eightHundreds for #239. - Enforce
timeoutMsandmaxRuntimeMson async and background subagent runs. The per-launch deadline drives an AbortController that cancels acceptance verification, imported async roots, and fallback retries; direct children get SIGTERM with SIGKILL escalation on a bounded timer; nested descendants get timeout requests distinct from manual interrupt.timedOut,deadlineAt, anderrorpropagate across status, results, and nested summaries. Thanks to @pkese for #361.
- Keep generated subagent markdown outputs, progress files, and run artifacts under the project-local
.pi-subagents/directory by default. Thanks to Carolina (@carolitascl) for #326. - Detach foreground subagent runs immediately when a child starts a blocking
contact_supervisororintercom.askcall, avoiding parent/child intercom deadlocks. Thanks to huarkiou (@huarkiou) for #335. - Made child boundary prompt editing instructions tool-agnostic so Codex-style adapters are not told to call unavailable
edit/writetools. Thanks to Artem Timofeev (@atimofeev) for #338. - Recursively interrupt active async parallel children and nested async descendants when pausing a background run. Thanks to Vicary (@vicary) for #355.
- Avoid runtime peer imports from detached async runners while still forwarding the Pi package root when available. Thanks to @aurbina83 for #352 and @huangkun3251 for #342.
- Fall back to PATH
nodefor async runners when the current Node executable path is stale or deleted. Thanks to Richard Hao (@0xRichardH) for #347. - Retry fallback models when a zero-exit subagent attempt produces no output, including background async runs, preserve structured-output-only completions, and pre-warm forked session files for parallel children. Thanks to Clark Everson (@gr3enarr0w) for #344.
- Preserve explicit empty companion suggestion surfaces and keep global companion suggestions disabled when writing package dismissal state.
- Include bounded async runner stderr tails when stale-run reconciliation marks a startup crash failed. Thanks to Salem Sayed (@salemsayed) for #340.
- Persist forked child session files when Pi returns a branch path before writing it to disk. Thanks to @trisforrestcam for #174.
- Pass explicit
thinking: offthrough to child model arguments as a:offsuffix. Thanks to Thomas Dietert (@tdietert) for #147. - Sanitize Anthropic signed
thinking/redacted_thinkingblocks out of forked child sessions and force child thinking off so fork-context subagents survive signed-thinking transcripts after branching or compaction. Thanks to Thomas Dietert (@tdietert) for #147. - Restore queued and running detached async jobs into the widget after restarting Pi. Thanks to Vicary (@vicary) for #362.
- Fix session-start freeze where restoring active async jobs did O(runs × nested-route-dirs) directory scans over stale terminal runs;
listAsyncRunsnow builds a single nested-route index and filters by state before lookup.
- Added
/chaininline parallel groups with per-step metadata, group options, and tab completion. Thanks to loss-and-quick (@loss-and-quick) for #312. - Added subagent profile commands and provider model catalog generation for quota and quality model profiles. Thanks to tencnivel (@tencnivel) for #333.
- Discover
pi-intercominstallations created by--extension npm:pi-intercomunder Pi's temporary npm extension cache. Thanks to loss-and-quick (@loss-and-quick) for #336. - Made async subagent interrupt, steer, and stop requests portable across platforms that do not support Unix signals. Thanks to AeonDave (@AeonDave) for #332.
- Hardened profile commands by probing models without tools, rejecting unsafe profile/provider path tokens, and resolving short model IDs and thinking suffixes against the current registry.
- Limited inline
/chainacceptance values to levels expressible in slash syntax and kept completion disabled inside shared--tasks with literal parentheses.
- Added
subagents.disableThinkingso bundled builtin agents can drop thinking suffix defaults for providers that do not accept them. Thanks to Joshua Harding (@jhstatewide) for #212. - Discover nested grouped skills such as
.pi/skills/group/name/SKILL.mdso subagents match the host runtime's recursive skill lookup. Thanks to Weaxs (@Weaxs) for #262. - Follow Pi's configured project config directory for project-local agents, chains, skills, packages, settings, direct MCP config, and intercom package discovery instead of hardcoding
.pi, while retaining.pias the fallback for older Pi versions.
- Hardened npm installs by tracking
package-lock.json, pinning direct dependencies, and usingnpm ci --ignore-scriptsin CI and release workflows. Thanks to Modestas Vainius (@modax) for #234. - List configured subagent skills by name, description, and file path instead of inlining full skill bodies, and ensure tool-restricted children can read those skill files on demand. Thanks to Ruben Paz (@Istar-Eldritch) for #183.
- Resolve the async result watcher directory with
fs.realpathSync.native()beforefs.watch()so Windows profiles with 8.3 temp paths do not crash Pi when async subagent results arrive. Thanks to kerushidao (@kerushidao) for #254. - Accept structured acceptance reports emitted in JSON-family fences when the fenced body has the acceptance-report shape. Thanks to Suleiman Tawil (@stawils) for #253.
- Report field-level acceptance-report validation errors instead of a generic parse failure, and clarify array element types in the acceptance prompt. Thanks to Whisperfall (@Whisperfall) for #264 and josephkEA (@josephkEA) for the follow-up reproduction.
- Simplified the public
acceptanceand chain tool schemas so Kimi/Moonshot-style parsers can loadsubagent, while runtime validation still rejects malformed acceptance config and dynamic fanout steps. Thanks to Sergio Agosti (@sergio-agosti) for #249. - Reject duplicate concurrent
subagentexecution calls while a prior subagent dispatch is still in progress, keeping intentional parallel mode within a single call unchanged. Thanks to desideratum (@desideratum) for #247. - Bound async
events.jsonlgrowth by dropping noisy childmessage_updatesnapshots, capping persisted child diagnostics, and scanning control events in chunks during status polling. Thanks to Tri Van Pham (@pvtri96) for #246. - Keep crowded async subagent widgets at a stable collapsed height in short terminals, reducing destructive full-screen TUI redraws and flicker. Thanks to ssyram (@ssyram) for #186.
- Actually wire the previously documented foreground-only
timeoutMs/maxRuntimeMsaliases through single, parallel, chain, and dynamic fanout runs, including stabletimedOut: trueresults, preserved partial output, manual-interrupt precedence, and skipped acceptance verification after timeout. - Apply
subagents.agentOverrides.<name>to matching user-scope and project-scope custom agents, while keeping explicit agent frontmatter authoritative per field. Thanks to Jacek Juraszek (@jjuraszek) for #218. - Preserve compact foreground
write/edittool-call evidence in prompt-template delegation responses so convergence checks do not stop loops early. Thanks to Hans Schnedlitz (@hschne) for #207. - Respect each agent's
defaultContextin mixed parallel and chain subagent calls when no explicitcontextis provided, so fresh-default scouts no longer inherit forked parent transcripts just because another agent in the same invocation defaults to fork. Thanks to Mitch Fultz (@fitchmultz) for #228. - Make runtime
outputoverrides authoritative in child task and system prompts, and remove stale static filenames from bundled output-format instructions. Thanks to youngshine (@smithyyang) for #223. - Keep top-level parallel
defaultProgressfiles in run-scoped artifact storage instead of the parent working directory. Thanks to youngshine (@smithyyang) for #224.
- Allow active async chains to accept an
append-steprequest that adds one new tail step while the chain is still running. - Allow async subagent results to be attached as the root step of a new follow-up chain.
- Added
subagentOnlyExtensionsso agents can pass selected tool extensions only to spawned subagents without exposing them to the parent agent. - Added proactive skill-subagent suggestions to
subagent({ action: "list" })based on repeatedly configured skill use, while keeping the behavior advisory and opt-out friendly. - Added regression coverage for long worker/reviewer chains and parallel -> funnel -> fanout chain flows across foreground and async execution.
- Interrupt live async children before delivering
resumefollow-up messages so intercom nudges reach workers that are stuck mid-turn more reliably. - Reject appended chain steps with duplicate reserved output names or unknown named-output references before they are queued.
- Ignore legacy
.agents/skillsfiles during agent discovery so skill definitions are not registered as subagents. Thanks to chyax98 (@chyax98) for #257. - Launch detached async runners through Node when Pi itself is not the Node executable. Thanks to Tetsuya.dev (@tetsuya-dev-jp) for #273.
- Preserve the slash command requester context when bridge requests launch subagents. Thanks to Victor Sumner (@vsumner) for #268.
- Trim repeated nested
subagenttool schema descriptions so provider payloads stay compact while retaining top-level parameter guidance. Thanks to Thomas Mustier (@tmustier) for #250.
- Added package-provided agent and chain discovery from installed Pi packages and package settings, including read-only management behavior, package source counts in doctor output, nested-cwd project package discovery, and package definitions that remain below user/project overrides. Thanks to Fabian Jocks (@iamfj) for #278.
- Added
PI_SUBAGENT_EXTRA_AGENT_DIRSandPI_INTERCOM_EXTENSION_DIRoverrides so bundled agents andpi-intercomcan be loaded from read-only package locations. Thanks to David Barroso (@dbarrosop) for #288.
- Show captured output from failed foreground subagents instead of returning only the failure summary. Thanks to Jürgen Schmied (@jschmied) for #277.
- Preserve nested fanout child subagent history when building child prompts. Thanks to James Wood (@jamesjwood) for the original #270 fix.
- Retry Windows atomic JSON renames on transient
EPERM,EBUSY, andEACCESfailures. Thanks to Wings Butterfly (@wings1848) for #269. - Inherit the parent session model for subagents instead of falling back to global settings, including foreground, chain, async chain, async single, and resume/revive paths. Thanks to Rogerio Saulo (@rsaulo) for #266 and Nicolas Marchildon (@elecnix) for the original #283 fix.
- Avoid duplicate
subagenttool registration in fanout-authorized child processes. Thanks to Aleksei Gurianov (@Guria) for #279. - Hardened the parallel intercom integration test fixture after Windows CI exposed nondeterministic failure ordering.
- Added foreground-only
timeoutMs/maxRuntimeMsfor single, parallel, and chain subagent runs. Timed-out children are soft-interrupted, keep completed sibling/prior results, and returntimedOut: truewith a stable timeout message. - Added per-agent
maxExecutionTimeMsandmaxTokensresource limits. Foreground and async children stop with a clearresourceLimitExceededresult when the configured runtime or observed token budget is reached.
- Strengthened tool and skill guidance so writer subagents launched from plans, specs, issues, or broad fixes proactively use structured
acceptanceinstead of burying validation requirements only in task prose.
- Removed a provider-unfriendly required-only subschema from the public
acceptancetool schema so Kimi models served through OpenCode Go can load thesubagenttool, while keeping runtime validation for empty acceptance contracts. - Clarified acceptance-report prompts so required evidence like
diff-summarymust be copied into structured JSON fields such asdiffSummary, not only described in visible prose.
- Reworked public acceptance config to be object-only and evidence-driven, removing public
level/disable shorthands. Explicit acceptance now triggers a same-session self-review/repair finalization loop, withmaxFinalizationTurnscontrolling the cap. - Documented goal-style acceptance guidance so
/goal, “active goal”, and “work until evidence says done” requests map to run-scopedacceptancecontracts. - Refined acceptance finalization prompts and status output to emphasize evidence, blockers, stop rules, and finalization progress such as
completed after 1/3 turns.
- Treat explicit acceptance as the completion contract for acceptance-enabled runs, avoiding implementation completion-guard false positives when the visible output is only an
acceptance-reportor a finalization self-review turn does not need a repair edit.
- Added first-wave acceptance gates with optional public
acceptanceconfig, inferred effective policies, structured child reports, provenance ledgers, checked evidence gates, explicit runtime verification commands, async/status persistence, and saved.chain.jsonvalidation. - Added chain step metadata (
phase,label), named outputs (aswith{outputs.name}), workflow graph snapshots, and strictoutputSchemastructured-output contracts across foreground and async chain execution. - Added dynamic chain fanout with
expand/single-templateparallel/collect, structured named-output sources, bounded item expansion, collected result outputs, async status graph persistence, and saved.chain.jsonsupport.
- Fixed dynamic fanout acceptance blockers around real
structured_outputtool validation, malformed dynamic-like chain rejection, async dynamic failure status/details, dynamic child intercom target indexing, and saved.chain.jsonmanagement diagnostics. - Fixed acceptance-gate semantics so reviewed status requires an independent reviewer result, required criteria must be reported as satisfied, only fenced
acceptance-reportblocks satisfy attestation, malformed reports preserve parse errors,{ level: "none", reason }disables inferred gates, and zero-child dynamic aggregates no longer fabricate evidence.
- Allow child agents whose resolved builtin tools explicitly include
subagentto run child-safe nested fanout, with parent-visible nested status trees and nestedstatus/interrupt/resumeby id.
- Preserve compact nested child summaries in grouped result/intercom payloads and async completion metadata before ordinary result files are processed and deleted.
- Keep async result files retryable when nested registry enrichment temporarily fails, instead of marking them seen before a successful delivery pass.
- Require an explicit id for child-safe nested
statuswhen no local foreground run is active, preventing fanout children from listing unrelated top-level async runs. - Keep fanout child control inbox polling alive across transient filesystem errors, and retain control requests for retry when control-result writes fail.
- Share nested path/env sanitization between child launch arguments and nested event projection.
- Treat provider-coerced single-run
output: "false"the same as booleanfalse, preventing literalfalseoutput files in foreground and async runs. - Include selected direct MCP tool names in explicit child
--toolsallowlists when metadata cache/config resolution is available. - Honor
PI_CODING_AGENT_DIRfor runtime config, agent/chain/settings discovery, skills, run history, artifact cleanup, and intercom defaults. - Hide nested child Pi process windows on Windows for both foreground and background subagent runs.
- Avoid completion-guard false positives for declared read-only agents, and add
completionGuard: falsefor bash-enabled non-implementation agents that should not be required to edit files. - Skip empty or whitespace-only assistant text parts when selecting subagent final output, so later meaningful text in the same or earlier assistant message is not masked.
- Declare
@earendil-works/pi-tuias a runtime dependency so packaged installs can load the extension without relying on dev dependencies or optional peers. - Treat recovered intermediate child tool/provider errors as successful when a later clean final assistant response is emitted, preventing false failed subagent results.
- Use progress-driven spinner frames in subagent result rows and async widgets, avoiding timer-driven off-screen redraw flicker in small terminals.
- Show provider-free model and thinking labels in async subagent widgets and status views.
- Added a packaged
/review-loopprompt for parent-controlled worker, fresh-reviewer, and fix-worker cycles that can run as an initial async chain or as follow-up subagent runs after async worker completions, stopping when reviewers find no fixes worth doing now or the review-round cap is reached.
- Let
async: truechain tool calls run in the background whenclarifyis omitted, and avoid showing the async badge for explicit foreground clarify runs.
- Show the
Ctrl+Olive-detail affordance for running single async subagent widgets when step details are available, while keeping the generic activity fallback before step status arrives.
- Migrated Pi package imports and package metadata to the
@earendil-works/*scope, switched async TypeScript execution discovery to upstreamjiti, and hardened forked-session creation to use the publicSessionManager.open()path.
- Consolidated async step activity and parallel-outcome formatting used by widgets and
subagent({ action: "status" })output. - Updated
/parallel-reviewand/parallel-cleanupto end review synthesis with numbered follow-up choices, plus anautofixmode for automatically applying fixes worth doing now. - Include async run output paths in
subagent({ action: "status" })output so the remaining inspection path covers the logs previously surfaced by the removed overlay.
- Removed the unnecessary
/agentsmanager overlay, itsCtrl+Shift+Ashortcut, and theagentManager.newShortcutsetting to cut unnecessary UI surface area; agent and chain management remains available through tool actions, settings, and markdown files. - Removed persistent save actions from the chain clarify UI:
Sno longer writes runtime overrides back to agent frontmatter, andWno longer saves.chain.mdfiles. Clarify now only edits the imminent run. - Removed the
/subagents-statusread-only overlay and its slash command; async runs remain inspectable throughsubagent({ action: "status" }), completion notifications, logs, and the async widget. - Removed the standalone
src/tui/text-editor.ts; chain clarify now keeps its small runtime editor logic local to the only remaining consumer.
- Persist async per-child session metadata and remember recent foreground child session metadata so
resumecan revive multi-child async runs and foreground children by index.
- Keep foreground children alive when they call
contact_supervisorfor a blocking decision by treating it as intercom coordination during parent detach, matching the genericintercomhandoff path. - Pause foreground parallel and chain flows when a child detaches for intercom coordination instead of counting the child as a successful completed result and continuing the workflow, and suppress grouped completion receipts for detached chains.
- Tighten resume/revive safety by rejecting pending async children, detached foreground children that may still be live, ambiguous foreground/async id prefixes, and exact invalid resume matches that would otherwise be masked by a prefix match in the other namespace.
- Preserve child session metadata in stale-run repaired results and avoid advertising revive from top-level-only or missing child session files.
- Stop builtin
reviewerruns from writing progress by default, clarify that review-only/no-edit instructions win over progress-writing or artifact-writing instructions, and suppress automatic progress injection for explicit no-edit tasks even when chain templates use{task}. - Treat parsed provider errors as failed foreground and async subagent attempts even when the child process exits successfully, and baseline saved output files per fallback attempt.
- Preserve output-file read and inspect errors instead of silently overwriting or falling back when a changed saved-output path cannot be read.
- Show each active async widget row's lifecycle status (
running,complete,failed, orpaused) alongside activity and usage stats. - Start new direct, slash, prompt-template, foreground, and async subagent launches in compact view while keeping
Ctrl+Oavailable for live detail. - Label top-level async parallel completion notifications as parallel runs instead of leaking the internal chain-shaped runner plan.
- Detect
pi-intercomwhen installed through the documentedpi install npm:pi-intercompackage flow, instead of only checking the legacy local extension path.
- Store and discover saved chain workflows from dedicated chain directories: user chains in
~/.pi/agent/chains/**/*.chain.mdand project chains in.pi/chains/**/*.chain.md. - Retry foreground subagent fallback models when Pi reports a retryable provider error, such as 429/quota, even if the child process exits successfully.
- Align single-run async subagent widgets and
/subagents-statusrendering with foreground subagent result styling for parallel, chain, and grouped chain runs, including inline live detail when tool output expansion is enabled, while keeping multi-job async widgets compact. - Render async subagent widgets through an adaptive component so active parallel agent rows fit without Pi's fixed string-widget truncation marker.
- Tell parent agents that async runs are detached and they should end the turn instead of running sleep/poll loops when no independent work remains.
- Added child-only supervisor contact support for delegated subagents through
contact_supervisor, withneed_decisionfor blocking supervisor replies andprogress_updatefor concise non-blocking updates. - Pass supervisor intercom metadata into foreground, chain, parallel, and background child runs so the child-facing pi-intercom tool can resolve the delegating session automatically.
- Builtin agents now inherit the user's configured default model instead of pinning
openai-codex/gpt-5.5; use builtin overrides to pin a model for a role. - Hide unsupported thinking levels in subagent clarify and agent-manager pickers when Pi exposes per-model thinking metadata.
- Updated builtin agent prompts, README, and bundled skill docs to prefer
contact_supervisorfor blocked decisions and avoid child-side routine completion handoffs. - Teach reviewer agents that repo-local
progress.mdfiles are intentional scratch files that should remain untracked and covered by.gitignore.
- Added regression coverage for supervisor metadata propagation into child process environments.
- Show top-level async parallel runs as
parallelinstead ofchain, with foreground-style running/done wording in widgets and status output, and group running async chain detail by chain step. - Scoped
/subagents-statusto async runs launched from the current pi session instead of showing prior or unrelated sessions. - Declared the Pi TUI package as a direct dev dependency and added a manifest guard so CI installs do not rely on transitive optional peer dependencies for tests.
- Made prompt-runtime extension path assertions portable on Windows.
- Added explicit frontmatter
packageidentifiers for agents and saved chains, registering runtime names likecode-analysis.scoutwhile preserving separatenameandpackagefields on save. - Added recursive subdirectory discovery for user and project agent and chain definitions.
- Added
outputMode: "inline" | "file-only"for saved subagent outputs.inlineremains the default, whilefile-onlyreturns a concise saved-file reference instead of injecting full saved output back into the parent context.
- Marked Pi runtime peer dependencies as optional so npm package installs do not auto-install duplicate Pi packages or emit unrelated transitive dependency warnings.
- Debounce foreground
needs_attentionnotices, make them non-triggering, and cancel them when the run finishes so stale chain-step alerts do not launch parent turns after completion.
- Added a packaged
/parallel-context-buildprompt for parallelcontext-builderhandoff passes. - Added a packaged
/parallel-handoff-planprompt for external-reference research plus localcontext-builderpasses that produce an implementation handoff meta-prompt.
- Strengthened
context-builderguidance so handoffs require reading all relevant files and doing needed tool-available research before summarizing. - Expanded the bundled
pi-subagentsskill with tool-level recipes for the packaged prompt workflows, including context-build and handoff-plan patterns that parent agents can apply without slash commands. - Updated
README.mdto explain the bundledpi-subagentsskill, what it covers, and how it helps the orchestrating agent.
- Make active-long-running notices time-based by default, with turn and token thresholds available only as explicit opt-in budget guards.
- Stop async status listing from inventing
needs_attentionwith default thresholds when the runner has not persisted a control state. - Treat string
"false"output settings as disabled output so parallel reviewers do not collide on a/falseoutput path, including chain-parallel agent defaults. - Wrap long
/subagents-statusdetail output/event lines instead of truncating them with ellipses. - Treat cleanup after a clean terminal assistant stop as success even when the final assistant text is empty, using a short grace period before terminating lingering child processes without surfacing scary final-drain warnings.
- Express flexible tool schema fields as
anyOfunions without parent-leveltypearrays, avoiding schema shapes rejected by strict providers such as Moonshot/opencode-go.
- Changed the
/agentsnew-agent shortcut fromAlt+NtoShift+Ctrl+N, and addedagentManager.newShortcutconfig for overriding it.
- Fall back to polling async result files when native result watching is unavailable due to
EMFILEorENOSPC. - Treat forced final-drain termination after a valid final assistant output as cleanup success instead of failing the subagent run.
- Hide disabled builtin agents from
subagent({ action: "list" })output so agent-facing choices match executable runtime discovery. - Resolve intercom bridge default paths at runtime so tests and isolated environments that change
HOMEuse the correctpi-intercomlocation. - Made the tool-description source check tolerant of Windows line endings.
- Document the recommended parent-agent workflow as
clarify → planner → worker → fresh reviewers → workerin the docs and bundled skill. - Packaged
planner,worker, andoraclenow default to forked session context when the launch omitscontext; explicitcontext: "fresh"still overrides the agent default. - Expanded builtin subagent guidance so agents with a safe pi-intercom target can hand results back with blocking
intercom ask, documented the self-orchestrated clarify → plan → implement → review workflow, and added GPT-5.5-oriented subagent prompt guidance to the bundled skill andcontext-builder.
- Prevent child subagents from receiving parent orchestration tooling/history, and inject boundary instructions that forbid sub-delegation and pseudo tool calls.
- Added active-long-running and repeated mutating-tool failure notices so supervised/forked workers cannot burn turns silently while still appearing healthy.
- Fixed task editor wrapping so wide characters cannot push text past the right border.
- Mark implementation subagents as failed when they complete without any file mutation attempt.
- Applied the same no-mutation completion guard to async/background runner paths.
- Split terminal no-mutation guard notices from live idle notices so completed failures do not suggest status or interrupt commands.
- Clarified worker/intercom bridge instructions so blocked decisions use
intercom askand stay alive for the reply instead of completing with a question. - Labeled the Agents widget as async/background work so running detached agents are easier to identify.
- Reworked parallel progress wording so parallel runs show running/done agent counts (and chain parallel groups show
step X/Y · parallel groupwith agent fractions) instead of serialstep X/Ycounters. - Expanded
/parallel-cleanupguidance to flag redundant wrapper tests when one focused regression is enough. - Fixed flexible schema validation for
readsandskilloverrides soreads: false,skill: "review", andskill: falseno longer triggerelement.reads.every is not a function(issue #124). - Hardened slash-result and async-widget animation timers so stale extension contexts after
/newor reload stop their timers instead of crashing onctx.uiaccess (issue #122).
- Made the packaged
/parallel-cleanupprompt self-contained instead of referencing local-only cleanup skills.
- Added a packaged
/parallel-cleanupprompt for focused cleanup review passes.
- Consolidated the
oracle-executorrole intoworker:workernow usesopenai-codex/gpt-5.3-codexwith high thinking and stricter approved-direction guardrails, whileresearcherandcontext-buildernow use medium thinking. - Updated the bundled
scoutagent model/thinking defaults. - Hard-cut over grouped intercom bridge result delivery: with the bridge active, parent-side
pi-subagentsemits one groupedsubagent:result-intercommessage per foreground parent run (single, top-level parallel, or chain) and one per completed async result file. Acknowledged foreground delivery returns a compact receipt instead of duplicating full output in the normal tool result; unacknowledged delivery preserves the normal full output. Grouped messages include child intercom targets and full child summaries.
- Fixed status and manager row rendering so multiline or tabbed content cannot overflow table rows.
- Removed the bundled
oracle-executoragent and/oracle-executorprompt template in favor of usingworkerfor approved oracle handoffs.
- Updated the packaged
/parallel-reviewprompt so reviewer angles are generated dynamically from the user's intent, plan, implemented code, and current diff, with the listed angles framed as examples rather than fixed defaults.
- Added packaged prompt templates for common subagent workflows:
/parallel-research,/gather-context-and-clarify, and/oracle-executor.
- Tightened the packaged
/parallel-reviewprompt so fresh-context reviewers get distinct angles and return evidence-backed findings. - Refreshed the packaged
pi-subagentsskill with doctor diagnostics, saved-chain launches, prompt shortcuts, builtin overrides, intercom bridge guidance, fresh-context review defaults, and parallel task behavior. - Reworked the README around plain-language usage, good first prompts, packaged prompt shortcuts, builtin agent guidance, intercom setup, model overrides, and optional reference material.
- Added
subagent({ action: "doctor" })and/subagents-doctorfor read-only subagent environment diagnostics. - Added
/run-chainto launch saved.chain.mdworkflows directly from slash commands with completion, shared task input, and--bg/--forksupport.
- Added top-level parallel task support for per-task
output,reads, andprogress, including/parallelinline forwarding and async preservation. - Added
/agentslaunch toggles for forked context, background execution, and worktree-isolated parallel runs. - Added a read-only detail view to
/subagents-statusfor inspecting selected async runs, including recent events, output tails, and useful run paths. - Added a packaged
/parallel-reviewprompt template for launching fresh-context adversarial review subagents.
- Parallel and chain child runs now detach cleanly when a child uses intercom, preventing incoming handoff messages from aborting the parent foreground run.
- Restyled live subagent rendering, async widgets, and background completion notifications with compact Claude-style visual grammar while preserving existing observability paths.
- Parallel subagent result rendering now labels parallel workers as
Agent Ninstead ofStep N, while chain rendering keeps step terminology.
/runand single-agent tool calls now allow self-contained agents to run without a task string.- The
subagenttool description no longer advertises hardcoded builtin agent names and management list output now separates disabled builtins from executable agents. - Flexible
subagenttool schema fields now include explicit JSON Schema types so llama.cpp and local OpenAI-compatible providers accept them. - Settings package sources now resolve explicit
git:andnpm:entries from project and user package caches. - Slash-command subagent results are now export-friendly, including completed output and child session paths in visible export content.
- Added subagent control notifications so
needs_attentionsignals push structured parent events, persist async control events toevents.jsonl, show visible transcript notices for the user and parent agent, include proactivenudge/status/interruptcommands when a child appears blocked, and show each visible notice at most once per child run and attention state. - Added stable child intercom session names for controlled subagents so needs-attention pings can tell the orchestrator which agent needs attention and how to message it when intercom is available.
- Replaced the unreleased
starting/active/quiet/stalled/pausedactivity labels with factual activity reporting and a singleneeds_attentioncontrol signal, keepingpausedas lifecycle state only. - Added
subagent({ action: "status", id })andsubagent({ action: "status" })as the control-surface status checks, replacing the separatesubagent_status(...)tool. - Adjusted bundled agent defaults: most builtins now use
openai-codex/gpt-5.5, whilescoutusesopenai-codex/gpt-5.4-mini. - Removed the incomplete e2e suite and stale
@marcfargas/pi-test-harnessdev dependency;test:allnow runs the maintained unit and integration suites.
- Paused async runs now render
Background task pausednotifications instead of failed/completed copy, including after extension reloads with stale legacy listeners still present. - Async status output no longer shows stale activity-age lines for paused or completed runs.
- Added subagent control activity state for foreground and async runs, including
starting/active/quiet/stalled/pausedtracking, compact stalled/recovered/paused control events, and an in-toolaction: "interrupt"soft interrupt that pauses the current child turn without adding another top-level tool.
- Updated bundled agents to use
openai-codex/gpt-5.5defaults, withscoutonopenai-codex/gpt-5.5-miniandoracle-executoronopenai-codex/gpt-5.5:xhigh.
- Async/background status token reporting now falls back to in-memory model-attempt usage when detached runs do not produce session
.jsonlfiles, which also preserves token totals across model fallback retries. - Non-Windows subagent launches now use plain
piagain instead of reusing the current CLI script path, avoiding runs that get confused by installeddist/cli.jsentrypoints.
- Bundled a
pi-subagentsskill that teaches agents how to use builtin subagents, slash-command vs tool workflows, management-mode agent creation/editing, fork/intercom coordination, clarify mode, worktrees, async status inspection, and chain templating.
- Tightened the builtin
oracleprompt so intercom-enabled forked reviews now prefer concise conversational handoffs during the review and send a short final recommendation viapi-intercombefore returning the full structured result. - Tightened
oracle-executorso it explicitly frames itself as the single writer thread and escalates gaps in the approved direction instead of silently patching around them.
- Added builtin
oracleandoracle-executoragents for themain -> oracle -> main decision -> oracle-executorworkflow, plus README guidance for invoking the oracle pair with forked context.
- Migrated extension tool schemas from
@sinclair/typeboxtotypebox1.x so packaged installs follow Pi's current extension runtime contract.
- Moved TypeBox from
peerDependenciesto a realdependenciesentry sopi installproduction installs keep the schema package available at runtime.
- Added
forceTopLevelAsyncso depth-0 delegated runs can be forced into background mode withclarify: false, while nested runs keep their existing behavior.
- Background completion notifications now render
(no output)instead of a blank body when a completion summary is empty or whitespace-only. - Async status and token reporting now rerender more reliably when cleanup state changes, read token usage from
message.usage, and prefer the newest session file when multiple async session files exist. - Async/background startup now fails fast for invalid resolved
cwdvalues and spawn failures instead of reporting false launch success. - Sync and async runner paths now drain stuck child processes in bounded time, covering both post-exit stdio holders and children that emit a final message but never exit.
- Foreground subagent runs now make deeper live detail easier to discover. Running cards show an explicit
Ctrl+Ohint, lightweight live-state signals like recent activity, current-tool durations, and artifact output paths when available. Common array-heavy tool previews such asweb_search.queriesandfetch_content.urlsare now summarized more clearly instead of collapsing into opaque fallback text.
- Forked delegated runs now use stronger prompt-side guidance for
pi-intercomcoordination instead of runtime policing. The default fork preamble and intercom bridge instructions now explicitly treat inherited fork history as reference-only context, tell children not to continue the parent conversation in normal assistant text, and steer upstream questions or handoffs throughintercomwhen needed. - Documented an opt-in custom agent pattern for forked chat-back workflows so users can make that coordination contract explicit without changing builtin agents.
- Slash-run status text and
/subagents-statussummary output now use the same more explicit observability language, including clearer live-detail hints and surfaced output/session paths in the async status overlay. - Builtin agent defaults now prefer
openai-codexmodels forplanner,scout,researcher,context-builder, andworker.
- Removed the short-lived foreground intercom enforcement/retry layer from delegated fork runs. Coordination behavior is now shaped by prompt and agent design only, avoiding hidden retries, heuristic output inspection, and failure paths based on guessed intent.
- Builtin agents can now be disabled through
subagents.agentOverrides.<name>.disabledor the bulksubagents.disableBuiltinssetting, with/agentskeeping disabled builtins visible so they can be re-enabled from the manager. This builds on PR#81. Thanks @danielcherubini.
- Builtin disable precedence is now coherent across user and project settings: project overrides beat user overrides, project bulk disable beats user re-enable attempts, and same-scope per-agent overrides can opt an agent out of bulk disable.
/agentsnow blocks launching disabled builtins, shows their disabled state in list/detail views and management output, and avoids exposing the builtin-onlydisabledfield when editing normal user/project agents.- Multi-agent chain launches from
/agentsnow collect a task before dispatching instead of emitting an empty task, and settings read failures now surface as read errors instead of being mislabeled as parse failures.
- Parallel subagent startup no longer applies any worker-start stagger in
mapConcurrent().pi-subagentsnow relies on Pi core's settings/auth lock retry behavior instead of carrying its own startup-delay workaround.
- Top-level parallel
tasksmode now supports a per-callconcurrencyoverride, matching the existing chain parallel-step concurrency control. This ships part of issue#91. Thanks @Gabrielgvl.
- Top-level parallel defaults and limits can now be configured through
~/.pi/agent/extensions/subagent/config.jsonunderparallel.maxTasksandparallel.concurrency, while keeping the existing defaults of 8 tasks and concurrency 4 when unset. This completes issue#91. Thanks @Gabrielgvl.
context: "fork"sync runs now create child sessions from a throwaway session-manager instance opened on the persisted parent session file, instead of mutating the live parent session manager. This keeps the parent session writing to its own file so the matchingtoolResult(subagent)no longer lands in a descendant session by accident. This fixes issue#87. Thanks @asmisha.- Project agent and chain discovery now reads both
.agents/and.pi/agents/, while preferring.pi/agents/when both locations define the same parsed name and keeping manager writes on the.pi/agents/path. This fixes issue#88. Thanks @desek. - Ctrl+O expanded subagent results now actually show expanded content. Previously the
expandedflag was received but ignored, so task text and tool-call args were identically truncated in both views. Now expanded mode shows the full task and longer (but still bounded) tool-call previews. Additionally, tool calls are no longer lost after foreground compaction: compact display summaries are preserved and shown in expanded view even aftermessagesare stripped. This addresses issue#90. Thanks @asagajda.
- Added
systemPromptModeso subagents can replace Pi's base prompt with--system-promptinstead of always appending with--append-system-prompt, shipping the core of issue#85from @isvlasov. - Added
inheritProjectContextandinheritSkillsso child runs can keep or strip inherited project instruction files (AGENTS.md,CLAUDE.md, etc.) and Pi's discovered skills block.
- Builtin subagents now default to
systemPromptMode: replace, with builtindelegatestaying onappend. - Builtin agents now inherit project-level instruction files by default unless the user overrides them.
- Builtin agent prompts were rewritten for the new prompt-assembly model, and builtin
reviewer/context-buildertool lists now match their documented behaviors. This rounds out the prompt-assembly work merged in PR#92, which closed issue#85. Thanks @isvlasov.
- Cross-platform tests now avoid machine-specific Pi install paths, align homedir-sensitive settings discovery on Windows CI, and use deterministic async config-write failure fixtures.
- Request-level
cwdhandling is now consistent across management and execution paths.subagentrequests that target a worktree or nested checkout now resolve project agents, project settings, and builtin agent overrides from the requestedcwdinstead of accidentally inheriting the parent session's repo. This fixes issue#83. Thanks @hakin19 for the report. - Relative child
cwdvalues now resolve from the already-selected request/sharedcwdacross sync runs, async/background runs, chain steps, and top-level parallel tasks. This fixes cases where values likepackages/appwere interpreted from the wrong base directory, which could break skill lookup, output paths, and child process spawning. - Worktree parallel-mode validation now compares task-level
cwdoverrides after relative-path resolution, so equivalent paths like.no longer trigger false conflict errors against the shared worktree base. - Internal TypeScript source imports in the touched runtime paths now consistently use
.tslocal specifiers, matching the repo's direct TypeScript runtime loading conventions and reducing drift between adjacent modules.
- Completed foreground subagent results now return compact payloads instead of inlining full raw message histories and per-result progress objects, preventing long tool-heavy sync runs from overwhelming the parent agent return path.
- Prompt-template delegation now rebuilds minimal assistant messages from compact foreground results when raw message arrays are intentionally omitted.
- UI/status wording now uses plain text labels instead of glyph-heavy markers across foreground rendering, parallel summaries, save-result receipts, installer output, agent manager views, clarify screens, and the corresponding README/CHANGELOG examples.
- Added a realistic foreground integration repro for issue
#80and cleaned up the touched tests to remove the remaining bluntas anyfixture casts.
- Builtin agents can now be customized through settings-backed field overrides in
~/.pi/agent/settings.jsonand.pi/settings.jsonundersubagents.agentOverrides, with/agentsexposing a create/edit override flow instead of forcing full-file copies for model/thinking/tool/prompt tweaks.
- Shared temp paths are now scoped under a user-specific temp root across async result storage, async run state, chain directories, artifact fallback storage, and detached async config files, avoiding cross-user collisions on shared machines while still handling arbitrary-UID/container environments where
os.userInfo()can throw. - Async/background runs now launch child
piprocesses in JSON mode, stream child events intoevents.jsonlwith step metadata while the run is active, keepoutput-<n>.loglive with human-readable child output, and document thatsubagent-log-<id>.mdis a completion artifact. - Bare model IDs now prefer the active parent-session provider when that provider actually exposes the model, across sync, chain, parallel, async, and clarify flows. Ambiguous bare IDs still fall back to conservative resolution.
- Skill resolution now includes local package roots declared in project/user
settings.json -> packages, checks the effective taskcwdbefore the runtime cwd, and still falls back to the runtime cwd when a nested task inherits package-provided skills from the repo root.
- Intercom orchestration now uses a runtime-only
subagent-chat-<id>fallback target for unnamed sessions instead of persisting a generic session title, sopi --resumekeeps showing transcript snippets while delegated intercom routing still works. - GitHub Actions test workflow now uses
actions/checkout@v5andactions/setup-node@v5, removing Node 20 action-runtime deprecation warnings ahead of the enforced Node 24 transition. - Worktree cwd mapping now derives repo-relative prefixes from
git rev-parse --show-prefixinstead ofpath.relative(realpath, realpath), fixing Windows 8.3/canonical-path mismatches that could mapagentCwdback to the source repo instead of the created worktree. - Async background runs now pass the parent process
argv[1]through to the detached runner, so Windows child spawning keeps targeting the intendedpiCLI entry point instead of accidentally treating the runner'sjitibootstrap script aspi. - Intercom detach listeners now guard optional event-bus subscriptions with optional-call semantics, so delegated runs no longer fail when host event buses expose
emitwithouton. - Skill discovery no longer depends on runtime imports from
@mariozechner/pi-coding-agent; it now resolves skills directly from configured filesystem paths, preventingERR_MODULE_NOT_FOUNDcrashes in local/integration test environments.
- Added
intercomBridge.instructionFileso subagent intercom guidance can be overridden from a Markdown template with{orchestratorTarget}interpolation.
- Intercom-enabled delegated runs now detach only after the child actually starts the
intercomtool, preserving clean sync behavior until coordination is needed. - Graceful intercom coordination no longer leaves detached child runs vulnerable to later parent abort listeners, and reply confirmation follow-ups avoid unnecessary orchestrator aborts.
- Child process spawn failures now preserve the original error message instead of collapsing to a generic failure.
intercomBridgenow defaults toalwaysso intercom coordination instructions are injected for bothfreshandforkdelegated runs whenpi-intercomis available.
- Added optional intercom orchestration bridge for delegated runs. When enabled via
intercomBridge(defaultfork-only) andpi-intercomis available, child subagents get runtime coordination instructions for contacting the orchestrator session viaintercom, andintercomis auto-added to the child tool allowlist when needed. - Added unit coverage for intercom bridge activation, config handling, and extension allowlist behavior.
- Normalized
subagent-executor.tsrelative imports to.tsspecifiers to match direct TypeScript runtime loading. - Documented
pi-intercominstallation and activation requirements in README.
- Tightened intercom extension allowlist matching to avoid false positives from similarly named extension paths.
- Added native agent
fallbackModelssupport. Agents can now declare ordered backup models, and single, chain, parallel, and async/background runs retry on provider/model-style failures such as quota, auth, timeout, or provider/model unavailability.
- Fallback attempts now preserve observability across sync and async execution: results, artifact metadata, async status, and run logs record attempted models and per-attempt outcomes instead of only the final pass.
- Child subagent runs now pass model selections through
--modelinstead of--models, so live execution pins the intended model correctly and end-to-end fallback behavior matches the validated test path.
- Slash-command result cards now finalize through the extension's own snapshot timing instead of relying on core to treat hidden custom messages as in-place updates. The final slash snapshot and hidden persisted message are written before the last status-clear redraw, so live
/run,/chain, and/parallelcards update to their final state more reliably. - Added focused slash-command regression coverage for the success/error ordering around visible placeholder messages, hidden final messages, and the final status-clear redraw.
- Added configurable subagent recursion depth controls with global
maxSubagentDepthconfig and per-agentmaxSubagentDepthfrontmatter overrides. Child delegation now honors stricter inherited limits while still allowing per-agent tightening. - Added optional worktree setup hooks via extension config (
worktreeSetupHook,worktreeSetupHookTimeoutMs). Hooks run once per created worktree, receive JSON over stdin, return JSON on stdout, and can declare synthetic helper paths (e.g..venv, copied local config files) to exclude from patch capture.
- Added support for loading agents and skills from
.agents/and~/.agents/directories. - Switched internal source imports from
.jsto.tsso the extension can be loaded directly from TypeScript sources under the strip-types/transform-types runtime path. - Declared pi runtime packages and
@sinclair/typeboxas peer dependencies so direct source-loading environments fail less often from missing package resolution. - Single-output runs now preserve agent-written file contents instead of overwriting them with the final assistant receipt, and artifacts/truncation now follow the authoritative saved file content.
- Async/background runs now reuse the current Node executable and prefer the resolved current pi CLI path on all platforms, avoiding PATH drift from wrapped or version-pinned parent launches.
- Added release documentation for TypeScript direct-runtime loading support and related package requirements.
- Bumped pi package devDependencies to
^0.65.0(@mariozechner/pi-agent-core,@mariozechner/pi-ai,@mariozechner/pi-coding-agent) to stay aligned with current pi SDK/runtime.
- Updated session lifecycle handling for pi 0.65.0 by removing legacy post-transition resets and relying on
session_startreinitialization, matching pi's removal ofsession_switchandsession_forkextension events.
- Added git worktree isolation for parallel execution via
worktree: true. Applies to top-level paralleltasks, chain steps with{ parallel: [...] }, and async/background chain execution. Each parallel task gets its own temporary git worktree, and the aggregated output now includes per-task diff stats plus the directory path containing full patch files. - Added
worktree.tsto manage worktree lifecycle, diff capture, patch generation, and cleanup for isolated parallel runs. - Added
count: Nshorthand for top-level paralleltasksand chainparallelentries so one authored task can expand into repeated identical runs without manual duplication. - Added
subagent_status({ action: "list" })to list active async runs with flattened step/member status summaries. - Added
/subagents-status, a read-only overlay for active async runs plus recent completed/failed runs with per-run step details. The overlay auto-refreshes while open and preserves the selected run when possible. - Documented worktree isolation, async status surfaces, and the reorganized test layout in the README.
- Consolidated tests under
test/unit,test/integration,test/e2e, andtest/support, replacing the old mixed root-level andtest/layout. Test scripts now target those directories explicitly. - Integration tests now use a tiny local file-based mock
piharness instead of relying on the external subprocess harness for normal subagent execution. - Removed legacy extra session lifecycle resets and now rely on immutable-session
session_startreinitialization, matching pi's removal of post-transitionsession_switch/session_forkevents.
- Loader-based tests now resolve
.js→.tsimports correctly when the repository path contains spaces or other URL-escaped characters. Added a focused regression test for the custom test loader. - Worktree-isolated parallel runs now reject task-level
cwdoverrides that differ from the shared batch/stepcwd, instead of silently ignoring them. Applies to foreground parallel runs, chain parallel steps, and async/background execution. - Worktree diff capture now includes committed, modified, and newly created files without accidentally including the synthetic
node_modulessymlink used inside temporary worktrees. - Worktree setup now cleans up already-created worktrees if a later worktree in the same batch fails to initialize.
- Prompt-template delegated parallel responses now preserve the aggregate worktree summary text instead of dropping it when rebuilding the final delegated output.
- Async status and result JSON files are now written atomically so readers do not observe partial JSON during background updates.
readStatus()now returnsnullonly for genuinely missing files and preserves real inspect/read/parse failures with context.- Async status polling and result watching now log status/result/watcher failures instead of silently swallowing them, making background completion/debugging failures visible.
- Slash-command tests now match the current live snapshot contract instead of asserting the stale pre-finalized inline state.
- Tool history (
recentTools) in execution progress is now chronological (oldest first) and uncapped, replacing the old newest-first order with a 5-entry cap. Affects all execution paths (tool, slash commands, chains, parallel, async, delegation). Both single-task and chain-step render paths inrender.tsnow consistently useslice(-3)for most-recent display. - Removed 50ms throttle on execution progress updates.
onUpdatenow fires immediately on every tool start, tool end, message end, and tool result. Affects all execution paths. - Delegation bridge now passes through full
recentOutputLinesarrays,recentToolshistory, and resolvedmodelto prompt-template consumers, replacing the old stripped-down single-line updates.
- Updated for pi 0.62.0 compatibility.
Skill.sourcereplaced withSkill.sourceInfofor skill provenance,Widgettype replaced withComponent. Bumped devDependencies to^0.62.0.
- Trimmed tool schema and description to reduce per-turn token cost by ~166 tokens (13%). Removed
maxOutputfrom the LLM-facing schema (still accepted internally), shortenedcontextandoutputdescriptions, removed redundant CHAIN DATA FLOW section from tool description, condensed MANAGEMENT bullet points.
/agentsoverlay launches (single, chain, parallel) and slash commands (/run,/chain,/parallel) now render an inline result card in chat instead of relaying throughsendUserMessage./agentsoverlay chain launches no longer bypass the executor for async fallback, fixing a path where async chain errors were silently swallowed.
- All slash and overlay subagent execution now routes through an event bus request/response protocol (
slash-bridge.ts), matching the pattern used by pi-prompt-template-model. This replaces both the oldsendUserMessagerelay and the directexecuteChaincall in the overlay handler. - Slash launches show a live inline card immediately on start that streams current tool, recent tools, and output in real time, rather than appearing only after completion.
/parallelnow uses the nativetasksparameter directly instead of wrapping through{ chain: [{ parallel: tasks }] }.
slash-bridge.ts— event bus bridge for slash command execution. Manages AbortController lifecycle, cancel-before-start races, and progress streaming viasubagent:slash:*events.slash-live-state.ts— request-id keyed snapshot store that drives live inline card rendering during execution and restores finalized results from session entries on reload.- Clarified README Usage section to distinguish LLM tool parameters from user-facing slash commands.
- Prompt-template delegation bridge now supports parallel task execution: accepts
tasksarray payloads, emits per-taskparallelResultswith individual error/success states, and streams per-task progress updates withtaskProgressentries.
- Removed the cwd mismatch guard from the prompt-template delegation bridge, allowing delegated requests to specify a working directory different from the active session's cwd.
- Added
delegatebuiltin agent — a lightweight subagent with no model, output, or default reads. Inherits the parent session's model, making it the natural target for prompt-template delegated execution.
- Added fork context preamble: tasks run with
context: "fork"are now wrapped with a default preamble that anchors the subagent to its task, preventing it from continuing the parent conversation. The default isDEFAULT_FORK_PREAMBLEintypes.ts. Internal/programmatic callers can usewrapForkTask(task, false)to disable it or pass a custom string (this is not exposed as a tool parameter). - Added a prompt-template delegation bridge (
prompt-template-bridge.ts) on the shared extension event bus. The subagent extension now listens forprompt-template:subagent:requestand emits correlatedstarted/response/updateevents, with cwd safety checks and race-safe cancellation handling. - Added delegated progress streaming via
prompt-template:subagent:update, mapped from subagent executoronUpdateprogress payloads.
- Session lifecycle reset now preserves the latest extension context for event-bus delegated runs.
[fork]badge is now shown only on the result row, not duplicated on both the tool-call and result rows.
- Added explicit execution context mode for tool calls:
context: "fresh" | "fork"(default:fresh). - Added true forked-context execution for single, parallel, and chain runs. In
forkmode each child run now starts from a real branched session file created from the parent session's current leaf. - Added
--forkslash-command flag for/run,/chain, and/parallelto forwardcontext: "fork". - Added regression coverage for fork execution/session wiring and fork badge rendering, including slash command forwarding tests.
- Session argument wiring now supports
--session <file>in addition to--session-dir, enabling exact leaf-preserving forks without summary injection. - Async runner step payloads now carry per-step session files so background single/chain/parallel executions can also honor
context: "fork". - Clarified docs for foreground vs background semantics so
--bgbehavior is explicit.
context: "fork"now fails fast with explicit errors when parent session state is unavailable (missing persisted session, missing current leaf, or failed branch extraction), with no silent fallback tofresh.- Fork-session creation errors are now surfaced as tool errors instead of bubbling as uncaught exceptions during execution.
- Session directory preparation now fails loudly with actionable errors (instead of silently swallowing mkdir failures).
- Async launch now fails with explicit errors when the async run directory cannot be created.
- Share logs now correctly include forked session files even when no session directory exists.
- Tool-call and result rendering now explicitly show
[fork]whencontext: "fork"is used, including empty-result responses. subagent_statusnow surfaces async result-file read failures instead of returning a misleading missing-status message.
- Decomposed
index.ts(1,450 → ~350 lines) into focused modules:subagent-executor.ts,async-job-tracker.ts,result-watcher.ts,slash-commands.ts. Shared mutable state centralized inSubagentStateinterface. Three identical session handlers collapsed into one. - Extracted shared pi CLI arg-builder (
pi-args.ts) from duplicated logic inexecution.tsandsubagent-runner.ts. - Consolidated
mapConcurrent(canonical inparallel-utils.ts, re-exported fromutils.ts),aggregateParallelOutputs(canonical inparallel-utils.tswith optional header formatter, re-exported fromsettings.ts), andparseFrontmatter(extracted tofrontmatter.ts).
--no-skillswas missing from the async runner (subagent-runner.ts). PR #41 added skill scoping to the sync path but the async runner spawns pi through its own code path, so background subagents with explicit skills still got the full<available_skills>catalog injected.defaultSessionDirandsessionDirwith~paths (e.g."~/.pi/agent/sessions/subagent/") were not expanded —path.resolve("~/...")treats~as a literal directory name. Added tilde expansion matching the existing pattern inskills.ts.- Multiple subagent calls within a session would collide when
defaultSessionDirwas configured, since it wasn't appending a uniquerunId. BothdefaultSessionDirand parent-session-derived paths now getrunIdappended.
- Removed exported
resolveSessionRoot()function andSessionRootInputinterface. These were introduced by PR #46 but never called in production — the inline resolution logic diverged (always-on sessions,runIdappended) making the function's contract misleading. Associated tests and dead code from PR #47 scaffolding also removed frompath-handling.test.ts.
- Session persistence: Subagent sessions are now stored alongside the parent session file instead of in
/tmp. If the parent session is~/.pi/agent/sessions/abc123.jsonl, subagent sessions go to~/.pi/agent/sessions/abc123/{runId}/run-{N}/. This enables tracking subagent performance over time, analyzing token usage patterns, and debugging past delegations. Falls back to a unique temp directory when no parent session exists (API/headless mode).
- Background mode toggle in clarify TUI: Press
bto toggle background/async execution for any mode (single, parallel, chain). Shows[b]g:ONin footer when enabled. Previously async execution required programmaticclarify: false, async: true— now users can interactively choose background mode after previewing/editing parameters. --bgflag for slash commands:/run scout "task" --bg,/chain scout "task" -> planner --bg,/parallel scout "a" -> scout "b" --bgnow run in background without needing the TUI.
- Task edits in clarify TUI were lost when launching in background mode if no other behavior (model, output, reads) was modified. The async handoff now always applies the edited template.
- Async parallel chain support: Chains with
{ parallel: [...] }steps now work in async mode. Previously they were rejected with "Async mode doesn't support chains with parallel steps." The async runner now spawns concurrent pi processes for parallel step groups with configurableconcurrencyandfailFastoptions. Inspired by PR #31 from @marcfargas. - Comprehensive test suite: 85 integration tests and 12 E2E tests covering all execution modes (single, parallel, chain, async), error handling, template resolution, and tool validation. Uses
@marcfargas/pi-test-harnessfor subprocess mocking and in-process session testing. Thanks @marcfargas for PR #32. - GitHub Actions CI workflow running tests on both Ubuntu and Windows with Node.js 24.
- BREAKING:
shareparameter now defaults tofalse. Previously, sessions were silently uploaded to GitHub Gists without user consent. Users who want session sharing must now explicitly passshare: true. Added documentation explaining what the feature does and its privacy implications.
mapConcurrentwithlimit=0returned array of undefined values instead of processing items sequentially. Now clamps limit to at least 1.- ANSI background color bleed in truncated text. The
truncLinefunction now properly tracks and re-applies all active ANSI styles (bold, colors, etc.) before the ellipsis, preventing style leakage. Also usesIntl.Segmenterfor correct Unicode/emoji handling. Thanks @monotykamary for identifying the issue. detectSubagentErrorno longer produces false positives when the agent recovers from tool errors. Previously, any error in the last tool result would override exitCode 0→1, even if the agent had already produced complete output. Now only errors AFTER the agent's final text response are flagged. Thanks @marcfargas for the fix and comprehensive test coverage.- Parallel mode (
tasks: [...]) now returns aggregated output from all tasks instead of just a success count. Previously only returned "3/3 succeeded" with actual task outputs lost. - Session sharing fallback no longer fails with
ERR_PACKAGE_PATH_NOT_EXPORTED. The fallback now resolves the main entry point and walks up to find the package root instead of trying to resolvepackage.jsondirectly. - Skills from globally-installed npm packages (via
pi install npm:...) are now discoverable by subagents. Previously only scanned local.pi/npm/node_modules/paths, missing the global npm root where pi actually installs packages. - Windows compatibility: Fixed
ENAMETOOLONGerrors when tasks exceed command-line length limits by writing long tasks to temp files using pi's@filesyntax. Thanks @marcfargas. - Windows compatibility: Suppressed flashing console windows when spawning async runner processes (
windowsHide: true). - Windows compatibility: Fixed pi CLI resolution in async runner by passing
piPackageRootthrough togetPiSpawnCommand. - Cross-platform paths: Replaced
startsWith("/")checks withpath.isAbsolute()for correct Windows absolute path detection. Replaced template string path concatenation withpath.join()for consistent path separators. - Resilience: Added error handling and auto-restart for the results directory watcher. Previously, if the directory was deleted or became inaccessible, the watcher would die silently.
- Resilience: Added
ensureAccessibleDirhelper that verifies directory accessibility after creation and attempts recovery if the directory has broken ACLs (can happen on Windows with Azure AD/Entra ID after wake-from-sleep).
- TUI crash on async subagent completion: "Rendered line exceeds terminal width."
render.tsnever truncated output to fit the terminal — widget lines (agents.join(" -> ")), chain visualizations, skills lists, and task previews could all exceed the terminal width. AddedtruncLinehelper using pi-tui'struncateToWidth/visibleWidthand applied it to everyTextwidget and widget string. Task preview lengths are now dynamic based on terminal width instead of hardcoded. - Agent Manager scope badge showed
[built]instead of[builtin]in list and detail views. Widened scope column to fit.
- Builtin agents were silently excluded from management listings, chain validation, and agent resolution. Added
allAgents()helper that includes all three tiers (builtin, user, project) and applied it tohandleList,findAgents,availableNames, andunknownChainAgents. resolveTargetnow blocks mutation of builtin agents with a clear error message suggesting the user create a same-named override, instead of allowingfs.unlinkSyncorfs.writeFileSyncon extension files.- Agent Manager TUI guards: delete and edit actions on builtin agents are blocked with an error status. Detail screen hides
[e]ditfrom the footer for builtins. Scope badge shows[builtin]instead of falling through to[proj]. - Cloning a builtin agent set the scope to
"builtin"at runtime (violating the"user" | "project"type), causing wrong badge display and the clone inheriting builtin protections until session reload. Now maps to"user". - Agent Manager
loadEntriessuppresses builtins overridden by user/project agents, preventing duplicate entries in the TUI list. BUILTIN_AGENTS_DIRresolved viaimport.meta.urlinstead of hardcoded~/.pi/agent/extensions/subagent/agentspath. Works regardless of where the extension is installed.handleCreatenow warns when creating an agent that shadows a builtin (informational, not an error).
- Simplified Agent Manager header from per-scope breakdown to total count (per-row badges already show scope).
- Reviewer builtin model changed from
openai/gpt-5.2toopenai-codex/gpt-5.3-codex. - Removed
code-reviewerbuiltin agent (redundant withreviewer).
- Builtin agents — the extension now ships with a default set of agent definitions in
agents/. These are loaded with lowest priority so user and project agents always override them. New users get a useful set of agents out of the box without manual setup.scout— fast codebase recon (claude-haiku-4-5)planner— implementation plans from context (claude-opus-4-6, thinking: high)worker— general-purpose execution (claude-sonnet-4-6)reviewer— validates implementation against plans (gpt-5.3-codex, thinking: high)context-builder— analyzes requirements and codebase (claude-sonnet-4-6)researcher— autonomous web research with search, evaluation, and synthesis (claude-sonnet-4-6)
"builtin"agent source — new third tier in agent discovery. Priority: builtin < user < project. Builtin agents appear in listings with a[builtin]badge and cannot be modified or deleted through management actions (create a same-named user agent to override instead).
- Async subagent session sharing no longer fails with
ERR_PACKAGE_PATH_NOT_EXPORTED. The runner triedrequire.resolve("@mariozechner/pi-coding-agent/package.json")to find pi's HTML export module, but pi'sexportsmap doesn't include that subpath. The fix resolves the package root in the main pi process by walking up fromprocess.argv[1]and passes it to the spawned runner through the config, bypassingrequire.resolveentirely. The Windows CLI resolution fallback ingetPiSpawnCommandbenefits from the same walk-up function.
- Async subagent execution no longer fails with "jiti not found" on machines without a global
jitiinstall. The jiti resolution now tries three strategies: vanillajiti, the@mariozechner/jitifork, and finally resolves@mariozechner/jitifrom pi's own installation viaprocess.argv[1]. Since pi always ships the fork as a dependency, async mode now works out of the box. - Improved the "jiti not found" error message to explain what's needed and how to fix it.
- JSONL artifact files no longer written by default — they duplicated pi's own session files and were the sole cause of
subagent-artifactsdirectories growing to 10+ GB. ChangedincludeJsonldefault fromtruetofalse._output.mdand_meta.jsonstill capture the useful data. - Artifact cleanup now covers session-based directories, not just the temp dir. Previously
cleanupOldArtifactsonly ran onos.tmpdir()/pi-subagent-artifactsat startup, while sync runs (the common path) wrote to<session-dir>/subagent-artifacts/which was never cleaned. Now scans all~/.pi/agent/sessions/*/subagent-artifacts/dirs on startup and cleans the current session's artifacts dir on session lifecycle events. - JSONL writer now enforces a 50 MB size cap (
maxBytesonJsonlWriterDeps) as defense-in-depth for users who opt into JSONL. Silently stops writing at the cap without pausing the source stream, so the progress tracker keeps working.
- Agent
extensionsfrontmatter support for extension sandboxing: absent field keeps default extension discovery, empty value disables all extensions, and comma-separated values create an explicit extension allowlist.
- Parallel chain aggregation now surfaces step failures and warnings in
{previous}instead of silently passing empty output. - Empty-output warnings are now context-aware: runs that intentionally write to explicit output paths are not flagged as warning-only successes in the renderer.
- Async execution now respects agent
extensionssandbox settings, matching sync behavior. - Single-mode
outputnow resolves explicit paths correctly: absolute paths are used directly, and relative paths resolve againstcwd. - Single-mode output persistence is now caller-side in both sync and async execution, so output files are still written when agents run with read-only tools.
- Pi process spawning now uses a shared cross-platform helper in sync and async paths; on Windows it prefers direct Node + CLI invocation to avoid
ENOENTand argument fragmentation. - Sync JSONL artifact capture now streams lines directly to disk with backpressure handling, preventing unbounded memory growth in long or parallel runs.
- Execution now defaults
agentScopetoboth, aligning run behavior with managementlistso project agents shown in discovery execute without explicit scope overrides. - Async completion notifications now dedupe at source and notify layers, eliminating duplicate/triple "Background task completed" messages.
- Async notifications now standardize on canonical
subagent:startedandsubagent:completeevents (legacy enhanced event emissions removed).
- Reworked
skills.tsto resolve skills through Pi core skill loading with explicit project-first precedence and support for project/user package and settings skill paths. - Skill discovery now normalizes and prioritizes collisions by source so project-scoped skills consistently win over user-scoped skills.
- Documentation now references
<tmpdir>instead of hardcoded/tmppaths for cross-platform clarity.
- Recursion depth guard (
PI_SUBAGENT_MAX_DEPTH) to prevent runaway nested subagent spawning. Default max depth is 2 (main -> subagent -> sub-subagent). Deeper calls are blocked with guidance to the calling agent.
chainDirparam for persistent chain artifacts — specify a directory to keep artifacts beyond the default 24-hour temp-directory cleanup. Relative paths are resolved to absolute viapath.resolve()for safe use in{chain_dir}template substitutions.
- Management mode for
subagenttool viaactionfield — the LLM can now discover, create, modify, and delete agent/chain definitions at runtime without manual file editing or restarts. Five actions:list— discover agents and chains with scope + descriptionget— full detail for agent or chain, including path and system prompt/stepscreate— create agent (.md) or chain (.chain.md) definitions fromconfig; immediately usableupdate— merge-update agent or chain fields, including rename with chain reference warningsdelete— remove agent or chain definitions with dangling reference warnings
- New
agent-management.tsmodule with all management handlers, validation, and serialization helpers - New management params in tool schema:
action,chainName,config - Agent/chain CRUD safeguards
- Name sanitization (lowercase-hyphenated) for create/rename
- Scope-aware uniqueness checks across agents and chains
- File-path collision checks to prevent overwriting non-agent markdown files
- Scope disambiguation for update/delete when names exist in both user and project scope
- Not-found errors include available names for fast self-correction
- Per-step validation warnings for model registry and skill availability
- Validate-then-mutate ordering — all validation completes before any filesystem mutations
- Config field mapping:
tools(comma-separated withmcp:prefix support),reads->defaultReads,progress->defaultProgress - Uniform field clearing — all optional string fields accept both
falseand""to clear - JSON string parsing for
configparam — handlesType.Any()delivering objects as JSON strings through the tool framework
- Agents Manager overlay — browse, view, edit, create, and delete agent definitions from a TUI opened via
Ctrl+Shift+Aor the/agentscommand- List screen with search/filter, scope badges (user/project), chain badges
- Detail screen showing resolved prompt, recent runs, all frontmatter fields
- Edit screen with field-by-field editing, model picker, skill picker, thinking picker, full-screen prompt editor
- Create from templates (Blank, Scout, Planner, Implementer, Code Reviewer, Blank Chain)
- Delete with confirmation
- Launch directly from overlay with task input and skip-clarify toggle (
Tab)
- Chain files —
.chain.mdfiles define reusable multi-step chains with YAML-style frontmatter per step, stored alongside agent.mdfiles- Chain serializer with round-trip parse/serialize fidelity
- Three-state config semantics:
undefined(inherit), value (override),false(disable) - Chain detail screen with flow visualization and dependency map
- Chain edit screen (raw file editing)
- Create new chains from the template picker or save from the chain-clarify TUI (
W)
- Save overrides from clarify TUI — press
Sto persist model/output/reads/skills/progress overrides back to the agent's frontmatter file, orW(chain mode) to save the full chain configuration as a.chain.mdfile - Multi-select and parallel from overlay — select agents with
Tab, thenCtrl+Rfor sequential chain orCtrl+Pto open the parallel builder- Parallel builder: add same agent multiple times, set per-slot task overrides, shared task input
- Progressive footer: 0 selected (default hints), 1 selected (
[ctrl+r] run [ctrl+p] parallel), 2+ selected ([ctrl+r] chain [ctrl+p] parallel) - Selection count indicator in footer
- Slash commands with per-step tasks —
/run,/chain, and/parallelexecute subagents with full live progress rendering and tab-completion. Results are sent to the conversation for the LLM to discuss.- Per-step tasks with quotes:
/chain scout "scan code" -> planner "analyze auth" - Per-step tasks for parallel:
/parallel scanner "find bugs" -> reviewer "check style" --delimiter also supported:/chain scout -- scan code -> planner -- analyze auth- Shared task (no
->):/chain scout planner -- shared task - Tab completion for agent names, aware of task sections (quotes and
--) - Inline per-step config:
/chain scout[output=ctx.md] "scan code" -> planner[reads=ctx.md] "analyze auth" - Supported keys:
output,reads(+separates files),model,skills,progress - Works on all three commands:
/run agent[key=val],/chain,/parallel
- Per-step tasks with quotes:
- Run history — per-agent JSONL recording of task, exit code, duration, timestamp
- Recent runs shown on agent detail screen (last 5)
- Lazy JSONL rotation (keeps last 1000 entries)
- Thinking level as first-class agent field —
thinkingfrontmatter field (off, minimal, low, medium, high, xhigh) editable in the Agents Manager- Picker with arrow key navigation and level descriptions
- At runtime, appended as
:levelsuffix to the model string - Existing suffix detection prevents double-application
- Displayed on agent detail screen
- Parallel live progress — top-level parallel execution (
tasks: [...]) now shows live progress for all concurrent tasks. Each task'sonUpdateupdates its slot in a shared array and emits a merged view, so the renderer can display per-task status, current tools, recent output, and timing in real time. Previously only showed results after all tasks completed. - Slash commands frozen with no progress —
/run,/chain, and/parallelcalledrunSync/executeChaindirectly, bypassing the tool framework. NoonUpdatemeant zero live progress, andawait-ing execution blocked the command handler, making inputs unresponsive. Now all three route throughsendToolCall→ LLM → tool handler, getting full live progress rendering and responsive input for free. /runmodel override silently dropped —/run scout[model=gpt-4o] tasknow correctly passes the model through to the tool handler. Addedmodelfield to the tool schema for single-agent runs.- Quoted tasks with
--inside split incorrectly — the segment parser now checks for quoted strings before the--delimiter, so tasks likescout "analyze login -- flow"parse correctly instead of splitting on the embedded--. - Chain first-step validation in per-step mode —
/chain scout -> planner "task"now correctly errors instead of silently assigning planner's task to scout. The first step must have its own task when using->syntax. - Thinking level ignored in async mode —
async-execution.tsnow applies thinking suffix to the model string before serializing to the runner, matching sync behavior - Step-level model override ignored in async mode —
executeAsyncChainnow usesstep.model ?? agent.modelas the base for thinking suffix, matching the sync path inchain-execution.ts - mcpDirectTools not set in async mode —
subagent-runner.tsnow setsMCP_DIRECT_TOOLSenv var per step, matching the sync path inexecution.ts {task}double-corruption in saved chain launches — stopped pre-replacing{task}in the overlay launch path; raw user task passed as top-level param toexecuteChain(), which usesparams.taskfororiginalTask- Agent serializer
skillnormalization —normalizedFieldnow maps"skill"to"skills"on the write path - Clarify toggle determinism — all four ManagerResult paths (single, chain, saved chain, parallel) now use deterministic JSON with
clarify: !result.skipClarify, eliminating silent breakage from natural language variants
- Agents Manager single-agent and saved-chain launches default to quick run (skip clarify TUI) — the user already reviewed config in the overlay. Multi-agent ad-hoc chains default to showing the clarify TUI so users can configure per-step tasks, models, output files, and skills before execution. Toggle with
Tabin the task-input screen. - Extracted
applyThinkingSuffix(model, thinking)helper from inline logic inexecution.ts, shared withasync-execution.ts - Text editor: added word navigation (Alt+Left/Right, Ctrl+Left/Right), word delete (Alt+Backspace), paste support
- Agent discovery (
agents.ts): loads.chain.mdfiles vialoadChainsFromDir, exposesdiscoverAgentsAllfor overlay
- MCP direct tools for subagents - Agents can request specific MCP tools as first-class tools via
mcp:prefix in frontmatter:tools: read, bash, mcp:chrome-devtoolsortools: read, bash, mcp:github/search_repositories. Requires pi-mcp-adapter. MCP_DIRECT_TOOLSenv var - Subagent processes receive their direct tool config via environment variable. Agents withoutmcp:items get a__none__sentinel to prevent config leaking from the parent process.
- Adapt execute signatures to pi v0.51.0: reorder signal, onUpdate, ctx parameters for subagent tool; add missing parameters to subagent_status tool
- README: Added agent file locations - New "Agents" section near top of README clearly documents:
- User agents:
~/.pi/agent/agents/{name}.md - Project agents:
.pi/agents/{name}.md(searches up directory tree) agentScopeparameter explanation ("user","project","both")- Complete frontmatter example with all fields
- Note about system prompt being the markdown body after frontmatter
- User agents:
- Google API compatibility: Use
Type.Any()for mixed-type unions (SkillOverride,output,reads,ChainItem) to avoid unsupportedanyOf/constJSON Schema patterns
- Skill support - Agents can declare skills in frontmatter that get injected into system prompts
- Agent frontmatter:
skill: tmux, chrome-devtools(comma-separated) - Runtime override:
skill: "name"orskill: falseto disable all skills - Chain-level skills additive to agent skills, step-level override supported
- Skills injected as XML:
<skill name="...">content</skill>after agent system prompt - Missing skills warn but continue execution (warning shown in result summary)
- Agent frontmatter:
- TUI skill selector - Press
[s]to browse and select skills for any step- Multi-select with space bar
- Fuzzy search by name or description
- Shows skill source (project/user) and description
- Project skills (
.pi/skills/) override user skills (~/.pi/agent/skills/)
- Skill display - Skills shown in TUI, progress tracking, summary, artifacts, and async status
- Parallel task skills - Each parallel task can specify its own skills via
skillparameter
- Chain summary formatting - Fixed extra blank line when no skills are present
- Duplicate skill deduplication -
skill: "foo,foo"now correctly deduplicates to["foo"] - Consistent skill tracking in async mode - Both chain and single modes now track only resolved skills
- Added
pi-packagekeyword for npm discoverability (pi v0.50.0 package system)
- Clarify TUI for single and parallel modes - Use
clarify: trueto preview/edit before execution- Single mode: Edit task, model, thinking level, output file
- Parallel mode: Edit each task independently, model, thinking level
- Navigate between parallel tasks with ↑↓
- Mode-aware TUI headers - Header shows "Agent: X" for single, "Parallel Tasks (N)" for parallel, "Chain: X → Y" for chains
- Model override for single/parallel - TUI model selection now works for all modes
- MAX_PARALLEL error mode - Now correctly returns
mode: 'parallel'(was incorrectlymode: 'single') output: truehandling - Now correctly treatstrueas "use agent's default output" instead of creating a file literally named "true"
- Schema description -
clarifyparameter now documents all modes: "default: true for chains, false for single/parallel"
- Thinking level selector in chain TUI - Press
[t]to set thinking level for any step- Options: off, minimal, low, medium, high, xhigh (ultrathink)
- Appends to model as suffix (e.g.,
anthropic/claude-sonnet-4-5:high) - Pre-selects current thinking level if already set
- Model selector in chain TUI - Press
[m]to select a different model for any step- Fuzzy search through all available models
- Shows the current model with a
currentbadge - Provider/model format (e.g.,
anthropic/claude-haiku-4-5) - Override indicator (✎) when model differs from agent default
- Model visibility in chain execution - Shows which model each step is using
- Display format:
Step 1: scout (claude-haiku-4-5) | 3 tools, 16.8s - Model shown in both running and completed steps
- Display format:
- Auto-propagate output changes to reads - When you change a step's output filename,
downstream steps that read from it are automatically updated to use the new filename
- Maintains chain dependencies without manual updates
- Example: Change scout's output from
context.mdtosummary.md, planner's reads updates automatically
- Progress is now chain-level -
[p]toggles progress for ALL steps at once- Progress setting shown at chain level (not per-step)
- Chains share a single progress.md, so chain-wide toggle is more intuitive
- Clearer output/writes labeling - Renamed
output:towrites:to clarify it's a file- Hotkey changed from
[o]to[w]for consistency
- Hotkey changed from
- {previous} data flow indicator - Shows on the PRODUCING step (not receiving):
↳ response → {previous}appears after scout's reads line- Only shows when next step's template uses
{previous} - Clearer mental model: output flows DOWN the chain
- Chain TUI footer updated:
[e]dit [m]odel [t]hinking [w]rites [r]eads [p]rogress
- Chain READ/WRITE instructions now prepended - Instructions restructured:
[Read from: /path/file.md]and[Write to: /path/file.md]prepended BEFORE task- Overrides any hardcoded filenames in task text from parent agent
- Previously: instructions were appended at end and could be overlooked
- Output file validation - After each step, validates expected file was created:
- If missing, warns: "Agent wrote to different file(s): X instead of Y"
- Helps diagnose when agents don't create expected outputs
- Root cause: agents need
writetool - Agents withoutwritein their tools list cannot create output files (they tried MCP workarounds which failed) - Thinking level suffixes now preserved - Models with thinking levels (e.g.,
claude-sonnet-4-5:high) now correctly resolve toanthropic/claude-sonnet-4-5:highinstead of losing the provider prefix
- Per-step progress indicators - When progress is enabled, each step shows its role:
- Step 1:
writes progress.md - Step 2+:
reads progress.md - Clear visualization of progress.md data flow through the chain
- Step 1:
- Comprehensive tool descriptions - Better documentation of chain variables:
- Tool description now explains
{task},{previous},{chain_dir}in detail - Schema descriptions clarify what each variable means and when to use them
- Helps agents construct proper chain queries for any use case
- Tool description now explains
- 4x faster polling - Reduced poll interval from 1000ms to 250ms (efficient with mtime caching)
- Mtime-based caching - status.json and output tail reads cached to avoid redundant I/O
- Unified throttled updates - All onUpdate calls consolidated under 50ms throttle
- Widget change detection - Hash-based change detection skips no-op re-renders
- Array optimizations - Use concat instead of spread for chain progress updates
- Timer leaks - Track and clear pendingTimer and cleanupTimers properly
- Updates after close - processClosed flag prevents updates after process terminates
- Session cleanup - Clear cleanup timers on session_start/switch/branch/shutdown
- Major code refactor - Split monolithic index.ts into focused modules:
execution.ts- Core runSync function for single agent executionchain-execution.ts- Chain orchestration (sequential + parallel steps)async-execution.ts- Async/background execution supportrender.ts- TUI rendering (widget, tool result display)schemas.ts- TypeBox parameter schemasformatters.ts- Output formatting utilitiesutils.ts- Shared utility functionstypes.ts- Shared type definitions and constants
- Expanded view visibility - Running chains now properly show:
- Task preview (truncated to 80 chars) for each step
- Recent tools fallback when between tool calls
- Increased recent output from 2 to 3 lines
- Progress matching - Added agent name fallback when index doesn't match
- Type safety - Added defensive
?? []forrecentOutputaccess on union types
- Full edit mode for chain TUI - Press
e,o, orrto enter a full-screen editor with:- Word wrapping for long text that spans multiple display lines
- Scrolling viewport (12 lines visible) with scroll indicators (↑↓)
- Full cursor navigation: Up/Down move by display line, Page Up/Down by viewport
- Home/End go to start/end of current display line, Ctrl+Home/End for start/end of text
- Auto-scroll to keep cursor visible
- Esc saves, Ctrl+C discards changes
- Tool description now explicitly shows the three modes (SINGLE, CHAIN, PARALLEL) with syntax - helps agents pick the right mode when user says "scout → planner"
- Chain execution observability - Now shows:
- Chain visualization with status labels:
done scout → running planner(done,running,pending,failed) - sequential chains only - Accurate step counter: "step 1/2" instead of misleading "1/1"
- Current tool and recent output for running step
- Chain visualization with status labels:
- Rebranded to
pi-subagents(waspi-async-subagents) - Now installable via
npx pi-subagents
- Chain TUI now supports editing output paths, reads lists, and toggling progress per step
- New keybindings:
o(output),r(reads),p(progress toggle) - Output and reads support full file paths, not just relative to chain_dir
- Each step shows all editable fields: task, output, reads, progress
- Chain clarification TUI edit mode now properly re-renders after state changes (was unresponsive)
- Changed edit shortcut from Tab to 'e' (Tab can be problematic in terminals)
- Edit mode cursor now starts at beginning of first line for better UX
- Footer shows context-sensitive keybinding hints for navigation vs edit mode
- Edit mode is now single-line only (Enter disabled) - UI only displays first line, so multi-line was confusing
- Added Ctrl+C in edit mode to discard changes (Esc saves, Ctrl+C discards)
- Footer now shows "Done" instead of "Save" for clarity
- Absolute paths for output/reads now work correctly (were incorrectly prepended with chainDir)
- Parallel-in-chain execution with
{ parallel: [...] }step syntax for fan-out/fan-in patterns - Configurable concurrency and fail-fast options for parallel steps
- Output aggregation with clear separators (
=== Parallel Task N (agent) ===) for{previous} - Namespaced artifact directories for parallel tasks (
parallel-{step}/{index}-{agent}/) - Pre-created progress.md for parallel steps to avoid race conditions
- TUI clarification skipped for chains with parallel steps (runs directly in sync mode)
- Async mode rejects chains with parallel steps with clear error message
- Chain completion now returns summary blurb with progress.md and artifacts paths instead of raw output
- Live progress display for sync subagents (single and chain modes)
- Shows current tool, recent output lines, token count, and duration during execution
- Ctrl+O hint during sync execution to expand full streaming view
- Throttled updates (150ms) for smoother progress display
- Updates on tool_execution_start/end events for more responsive feedback
- Async widget elapsed time now freezes when job completes instead of continuing to count up
- Progress data now correctly linked to results during execution (was showing "ok" instead of "...")
- Extension API support (registerTool) with
subagenttool name - Session logs (JSONL + HTML export) and optional share links via GitHub Gist
shareandsessionDirparameters for session retention control- Async events:
subagent:started/subagent:complete(legacy events still emitted) - Share info surfaced in TUI and async notifications
- Async observability folder with
status.json,events.jsonl, andsubagent-log-*.md subagent_statustool for inspecting async run state- Async TUI widget for background runs
- Parallel mode auto-downgrades to sync when async:true is passed (with note in output)
- TUI now shows "parallel (no live progress)" label to set expectations
- Tools passed via agent config can include extension paths (forwarded via
--extension)
- Chain mode now sums step durations instead of taking max (was showing incorrect total time)
- Async notifications no longer leak across pi sessions in different directories
Initial release forked from async-subagent example.
- Output truncation with configurable byte/line limits
- Real-time progress tracking (tools, tokens, duration)
- Debug artifacts (input, output, JSONL, metadata)
- Session-tied artifact storage for sync mode
- Per-step duration tracking for chains