- 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 current model with ✓ indicator
- 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:
● creates & updates progress.md - Step 2+:
↔ reads & updates 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 icons:
✓scout → ●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 icons:
- 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