pi-subagents 0.55.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -3
- package/agents/claude-code-writer.md +15 -0
- package/agents/claude-code.md +15 -0
- package/agents/codex-exec-writer.md +15 -0
- package/agents/codex-exec.md +15 -0
- package/agents/cursor-agent-writer.md +14 -0
- package/agents/cursor-agent.md +14 -0
- package/docs/agents.md +111 -15
- package/docs/configuration.md +37 -0
- package/docs/extension-api.md +2 -2
- package/docs/models.md +6 -0
- package/docs/observability.md +8 -7
- package/docs/tool-reference.md +11 -1
- package/docs/workflows.md +20 -0
- package/package.json +1 -1
- package/skills/pi-subagents/references/execution-controls.md +1 -1
- package/src/agents/agent-management.ts +13 -5
- package/src/agents/agent-refinements.ts +4 -4
- package/src/agents/agent-serializer.ts +2 -0
- package/src/agents/agents.ts +242 -49
- package/src/agents/builtin-names.ts +6 -0
- package/src/agents/runtime-agent-registry.ts +8 -2
- package/src/api/preflight.ts +22 -3
- package/src/extension/config.ts +70 -0
- package/src/extension/doctor.ts +3 -3
- package/src/extension/index.ts +18 -4
- package/src/extension/public-execution.ts +29 -13
- package/src/extension/rpc.ts +20 -5
- package/src/extension/schemas.ts +9 -3
- package/src/extension/tool-description.ts +11 -9
- package/src/inspectors/herdr/actions.ts +2 -1
- package/src/inspectors/herdr/inspector-runner.ts +2 -10
- package/src/inspectors/herdr/session-roots-codec.ts +42 -0
- package/src/integrations/herdr-status.ts +46 -3
- package/src/runs/background/active-async-capacity.ts +77 -10
- package/src/runs/background/async-execution.ts +148 -27
- package/src/runs/background/async-job-tracker.ts +5 -0
- package/src/runs/background/async-resume.ts +3 -0
- package/src/runs/background/async-retention.ts +20 -3
- package/src/runs/background/async-status.ts +5 -0
- package/src/runs/background/chain-root-attachment.ts +15 -1
- package/src/runs/background/fleet-view.ts +16 -10
- package/src/runs/background/inspect-rpc.ts +8 -8
- package/src/runs/background/result-files.ts +27 -14
- package/src/runs/background/result-watcher.ts +9 -5
- package/src/runs/background/run-status.ts +33 -6
- package/src/runs/background/scheduled-runs.ts +7 -1
- package/src/runs/background/subagent-runner.ts +254 -49
- package/src/runs/background/wait-completions.ts +4 -0
- package/src/runs/foreground/execution.ts +107 -16
- package/src/runs/foreground/foreground-control.ts +6 -0
- package/src/runs/foreground/foreground-history.ts +25 -3
- package/src/runs/foreground/subagent-executor.ts +324 -84
- package/src/runs/foreground/workflow-detach-reconcile.ts +31 -7
- package/src/runs/shared/acceptance.ts +10 -5
- package/src/runs/shared/agent-contract.ts +1 -1
- package/src/runs/shared/child-protocol.ts +21 -7
- package/src/runs/shared/claude-code-adapter.ts +129 -0
- package/src/runs/shared/codex-exec-adapter.ts +129 -0
- package/src/runs/shared/completion-guard.ts +3 -2
- package/src/runs/shared/cursor-agent-adapter.ts +114 -0
- package/src/runs/shared/dynamic-fanout.ts +1 -1
- package/src/runs/shared/extension-bindings.ts +78 -0
- package/src/runs/shared/external-cli-contract.ts +167 -0
- package/src/runs/shared/external-cli-preflight.ts +122 -0
- package/src/runs/shared/external-cli-runner.ts +349 -54
- package/src/runs/shared/fast-mode-extension.ts +10 -0
- package/src/runs/shared/model-exclusions.ts +59 -8
- package/src/runs/shared/model-fallback.ts +25 -8
- package/src/runs/shared/mutation-evidence.ts +150 -0
- package/src/runs/shared/nested-events.ts +3 -1
- package/src/runs/shared/nested-render.ts +2 -2
- package/src/runs/shared/parallel-utils.ts +3 -0
- package/src/runs/shared/pi-args.ts +47 -0
- package/src/runs/shared/process-signal.ts +13 -0
- package/src/runs/shared/run-history.ts +21 -1
- package/src/runs/shared/structured-output.ts +18 -4
- package/src/runs/shared/subagent-prompt-runtime.ts +9 -5
- package/src/shared/fork-context.ts +21 -0
- package/src/shared/formatters.ts +7 -1
- package/src/shared/launch-contract.ts +6 -0
- package/src/shared/pruned-fork.ts +450 -0
- package/src/shared/session-file-trust.ts +19 -0
- package/src/shared/session-tokens.ts +14 -3
- package/src/shared/settings.ts +16 -3
- package/src/shared/shortcuts.ts +17 -0
- package/src/shared/types.ts +166 -9
- package/src/shared/workflow-child-permit.ts +116 -0
- package/src/slash/delegation-adapters.ts +0 -1
- package/src/slash/slash-commands.ts +8 -6
- package/src/tui/fleet-status.ts +27 -10
- package/src/tui/fleet-transcript.ts +11 -5
- package/src/tui/fleet.ts +28 -13
- package/src/tui/render.ts +47 -21
- package/src/workflows/scripted-workflow.ts +298 -30
- package/src/workflows/workflow-child-summary.ts +117 -0
- package/src/workflows/workflow-receipt.ts +119 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,88 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
## [0.57.0] - 2026-08-26
|
|
6
|
+
|
|
7
|
+
### Highlights
|
|
8
|
+
- Run Codex, Claude Code, and Cursor Agent subagents with packaged read-only and writing profiles.
|
|
9
|
+
- Validate workflow scripts before launch, and reuse workflow code from files with `workflowScriptPath`.
|
|
10
|
+
- Resume, inspect, and recover workflow children more reliably after errors, compaction, or session reloads.
|
|
11
|
+
- See clearer Fleet and status output, including task labels and live context-window usage.
|
|
12
|
+
- Recover from more async, scheduling, discovery, model fallback, and Windows edge cases without losing useful run history.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- Add read-only and workspace-writing profiles for `codex-exec`, `claude-code`, and `cursor-agent`, with bounded result capture and opt-in smoke checks.
|
|
16
|
+
- Add external one-shot runner support for bounded parser hooks and logs, environment allowlists, cached launch preflight, parser progress, and process cleanup.
|
|
17
|
+
- Add compact external CLI capability and receipt metadata for adapter identity, artifacts, handoff mode, supervisor support, and resumability.
|
|
18
|
+
- Add configured pruned fork sessions with budgeted transcript-overflow summaries, stable recovery refs, and private recovery sidecars.
|
|
19
|
+
- Add offline `workflowScript` syntax and structural validation through the public subagent tool. Thanks to [@elecnix](https://github.com/elecnix) for #1462.
|
|
20
|
+
- Add `workflowScriptPath` so workflows can be loaded from files for execution, validation, and schedules. Thanks to [@elecnix](https://github.com/elecnix) for #1464.
|
|
21
|
+
- Add bounded workflow-child summaries to workflow results, status, receipts, and completion replay. Thanks to [@rochecompaan](https://github.com/rochecompaan) for #1453.
|
|
22
|
+
- Add live context-window usage to status and Fleet views, separate from cumulative token spend. Thanks to [@nazzeDe](https://github.com/nazzeDe) for #1444.
|
|
23
|
+
- Add active workflow task labels to compact status surfaces and Herdr pane metadata. Thanks to [@phoenixdam](https://github.com/phoenixdam) for #1459.
|
|
24
|
+
- Add `modelExclusions.defaultTtlMs` for controlling how long model exclusions stay active, with launch diagnostics for skipped candidates. Thanks to [@mithyer](https://github.com/mithyer) for #1439 and #1438.
|
|
25
|
+
- Add a package-internal one-use permit for one exact native child in a foreground `workflowScript`. Thanks to [@maroffo](https://github.com/maroffo) for #1494.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- Preserve agent frontmatter output defaults for prompt-template delegated leaves. Thanks to [@ashlineldridge](https://github.com/ashlineldridge) for #1521.
|
|
29
|
+
- Preserve structured-output and related bounded child contract fields when foreground workflow children resume. Thanks to [@Livan-pro](https://github.com/Livan-pro) for #1460.
|
|
30
|
+
- Preserve typed errors, partial output, transcript metadata, and artifact metadata when foreground workflow children resume. See #1513.
|
|
31
|
+
- Keep inline workflow children resumable from their foreground runs without mistaking a missing async directory for lost state. Thanks to [@lancegui](https://github.com/lancegui) for #1442.
|
|
32
|
+
- Make workflow validation and return serialization failures easier to recover from with no-child-launch diagnostics, portable rewrite guidance, workflow ids, and completed-child output references (#1432, #1434).
|
|
33
|
+
- Clarify terminal keyed workflow-resume failures when `workflow-receipt.json` is unavailable, including direct child-run recovery from status and event logs (#1512).
|
|
34
|
+
- Preserve bounded async child failure context after compaction, including missing file-only output, instead of leaving failed run summaries empty. See #1495.
|
|
35
|
+
- Ignore stale child-settled events from retrying compaction attempts, so resumed children are not aborted before their replacement attempt can finish. See #1504.
|
|
36
|
+
- Make async runs visible to exact status lookup as soon as launch succeeds, and deliver one completion when a runner dies before its normal status write. Thanks to [@rafafortes](https://github.com/rafafortes) for #1471 and [@VincentHanxiaoDu](https://github.com/VincentHanxiaoDu) for #1480.
|
|
37
|
+
- Record explicit completed, failed, timed-out, stopped, and interrupted outcomes in run history. Thanks to [@rafafortes](https://github.com/rafafortes) for #1474.
|
|
38
|
+
- Repair bounded dead async run candidates before retention classifies them, so stale run directories can be reclaimed without deleting ambiguous worktrees or branches. Thanks to [@rafafortes](https://github.com/rafafortes) for #1477.
|
|
39
|
+
- Exclude completed one-shot schedules from the pending schedule limit without deleting their durable history. Thanks to [@rafafortes](https://github.com/rafafortes) for #1478.
|
|
40
|
+
- Reclaim failed async capacity slots after a configurable abandoned timeout when the runner PID is gone, while keeping clear diagnostics for unknown process state. Thanks to [@rafafortes](https://github.com/rafafortes) for #1472.
|
|
41
|
+
- Preserve parent model inheritance for workflow children when workflow setup reads session data before launch, and avoid carrying a stale live-session model into scheduled owners. Thanks to [@alexei-led](https://github.com/alexei-led) for #1489 and #1490.
|
|
42
|
+
- Retry fallback models for transient provider connection failures. Thanks to [@genkikadomatsu](https://github.com/genkikadomatsu) for #1508.
|
|
43
|
+
- Resolve the `advisor` builtin alias through the bundled `oracle` definition in model listings. Thanks to [@smileBeda](https://github.com/smileBeda) for #1502.
|
|
44
|
+
- Follow symlinked directories during agent discovery without revisiting recursive links. Thanks to [@robsdudeson](https://github.com/robsdudeson) for #1505 and #1510.
|
|
45
|
+
- Explain unknown-agent failures with the effective cwd and discovery inputs. Thanks to [@genkikadomatsu](https://github.com/genkikadomatsu) for #1511.
|
|
46
|
+
- Resolve package subagents from bare HTTP(S) Git URLs stored in Pi settings. Thanks to [@trancikk](https://github.com/trancikk) for #1452.
|
|
47
|
+
- Preview runtime-recorded workflow child sessions in Fleet and inspect without trusting sibling transcripts. Thanks to [@JHa13y](https://github.com/JHa13y) for #1441.
|
|
48
|
+
- Distinguish same-agent parallel children in Fleet with their explicit task labels. Thanks to [@ljie-PI](https://github.com/ljie-PI) for #1487.
|
|
49
|
+
- Preserve the local user identity and temporary-directory environment needed by authenticated Claude Code adapter runs.
|
|
50
|
+
- Report child processes that exit during tool execution as mid-tool failures instead of cold starts, even when earlier assistant text exists. Thanks to [@cyzlmh](https://github.com/cyzlmh) for #1437.
|
|
51
|
+
- Keep unaddressable legacy result aliases and overlong public result filenames from blocking canonical hashed or pending fallbacks. Thanks to [@LeonardBode](https://github.com/LeonardBode) for #1440.
|
|
52
|
+
- Bypass repository fsmonitor hooks when collecting mutation evidence. Thanks to [@jpriverar](https://github.com/jpriverar) for #1497.
|
|
53
|
+
- Avoid the fatal Node `ReadFileUtf8` retention path. Thanks to [@pgoodjohn](https://github.com/pgoodjohn) for #1501.
|
|
54
|
+
- Base64-encode Herdr inspector session roots so `inspector.open` handles Windows PowerShell argument parsing correctly. Thanks to [@stavg91](https://github.com/stavg91) for #1499.
|
|
55
|
+
- Keep async runner terminal event delivery from crashing the session when the captured extension context is stale after a session replacement or reload. Thanks to [@AdrianAcala](https://github.com/AdrianAcala) for #1485.
|
|
56
|
+
- Reject non-string workflow-child summary identifiers when reading receipt metadata.
|
|
57
|
+
|
|
58
|
+
## [0.56.0] - 2026-08-23
|
|
59
|
+
|
|
60
|
+
### Highlights
|
|
61
|
+
- Run allowlisted OpenAI-Codex subagents with opt-in `fast` mode when you want priority service tier.
|
|
62
|
+
- Pass bounded extension metadata into native child launches without leaking that authority to external runners.
|
|
63
|
+
- Workflow scripts are easier to read when child results are stringified or returned.
|
|
64
|
+
- Completion guards now use safer tracked-file evidence, including large dirty files and interrupted runs.
|
|
65
|
+
- Model verification is less fragile for provider-qualified and variant-tagged model ids.
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
- Add opt-in `fast: true` launches for allowlisted native OpenAI-Codex subagents, using OpenAI's priority service tier.
|
|
69
|
+
- Add bounded namespaced extension bindings to child launch contracts. Thanks to [@FL03](https://github.com/FL03) for #1410.
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
- Render workflow child results as useful text when scripts stringify `runs.all` or awaited `runs.run` result objects.
|
|
73
|
+
- Keep checked acceptance compatible with strict workflow child `outputSchema` results. Thanks to [@rtbe](https://github.com/rtbe) for #1406.
|
|
74
|
+
- Use bounded tracked-file mutation evidence for implementation completion guards, including files that were already dirty when the child started. Thanks to [@rtbe](https://github.com/rtbe) for #1407.
|
|
75
|
+
- Bind fast mode into launch contract provenance and keep large tracked-file mutation evidence precise.
|
|
76
|
+
- Add timeout recovery summaries with changed tracked files, active child state, and session/artifact paths. Thanks to [@rtbe](https://github.com/rtbe) for #1409.
|
|
77
|
+
- Fail closed when reviewer runs are interrupted or detached workflow children settle without persisted top-level continuation proof. Thanks to [@rtbe](https://github.com/rtbe) for #1408.
|
|
78
|
+
- Stop flagging awaited `.then()` workflow chains as unawaited when a handler returns another child launch.
|
|
79
|
+
- Preserve variant-tagged model ids during verification and fallback exclusion parsing. Thanks to [@rafafortes](https://github.com/rafafortes) for #1420.
|
|
80
|
+
|
|
3
81
|
## [0.55.0] - 2026-08-23
|
|
4
82
|
|
|
5
83
|
### Highlights
|
|
6
84
|
- Stop a single stuck child in an async workflow without stopping the whole run.
|
|
7
|
-
- Continue finished external jobs, like
|
|
85
|
+
- Continue finished external jobs, like `gpt-pro` from [Surf](https://github.com/nicobailon/surf-cli/), with follow-up requests through `resume`.
|
|
8
86
|
- Cap child thinking with `subagents.maxThinking` and set a preferred default provider for bare model ids.
|
|
9
87
|
- Scripted workflow outputs now land in the run's managed artifact directory instead of the repository root.
|
|
10
88
|
- Child launches fail fast with clear reasons when requested models or write tools are unavailable.
|
|
@@ -31,10 +109,10 @@
|
|
|
31
109
|
- Fail child launch attempts when the runtime lacks requested core write tools or an implementation worker has only read-only launch tools, including workflow children that inherit a read-only capability ceiling.
|
|
32
110
|
- Let read-only reviewer acceptance rely on the parent-side staged-file check instead of requiring child-reported `noStagedFiles` evidence.
|
|
33
111
|
- Run public single-child launches directly instead of wrapping them in a workflow, so async external-job agents do not show a completed workflow before the real provider job finishes.
|
|
34
|
-
- Start omitted-`async` public external-runner single-child launches in the supported background mode, so package agents such as
|
|
112
|
+
- Start omitted-`async` public external-runner single-child launches in the supported background mode, so package agents such as `gpt-pro` from [Surf](https://github.com/nicobailon/surf-cli/) do not fail as foreground requests.
|
|
35
113
|
- Let workflow scripts await omitted-`async` external-runner children by launching them in the background internally and returning their terminal result.
|
|
36
114
|
- Report helpful workflow errors when `runs.all(...)` results are read as keyed objects instead of ordered arrays. Thanks to [@ravshansbox](https://github.com/ravshansbox) for #1351.
|
|
37
|
-
- Clarify that Council Mode can include installed external-runner advisors such as
|
|
115
|
+
- Clarify that Council Mode can include installed external-runner advisors such as `gpt-pro` from [Surf](https://github.com/nicobailon/surf-cli/) when the `surf-cli` Pi extension has registered `surf-oracle`, with text JSON reports instead of `outputSchema`.
|
|
38
116
|
|
|
39
117
|
## [0.54.0] - 2026-08-21
|
|
40
118
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-code-writer
|
|
3
|
+
description: Explicit file-writing Claude Code CLI mode; requires local authentication and trusted user settings/hooks
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: claude-code-writer
|
|
7
|
+
command: claude
|
|
8
|
+
promptDelivery: stdin
|
|
9
|
+
async: true
|
|
10
|
+
systemPromptMode: replace
|
|
11
|
+
inheritProjectContext: true
|
|
12
|
+
inheritSkills: false
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Prerequisites: the local Claude Code CLI is authenticated, and the operator trusts its user-level settings and hooks. Use only the code-owned Read, Write, Edit, Glob, and Grep tools. Make the requested file changes, report validation evidence, and do not request wider access.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-code
|
|
3
|
+
description: Read-only Claude Code CLI analysis; requires local authentication and trusted user settings/hooks
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: claude-code
|
|
7
|
+
command: claude
|
|
8
|
+
promptDelivery: stdin
|
|
9
|
+
async: true
|
|
10
|
+
systemPromptMode: replace
|
|
11
|
+
inheritProjectContext: true
|
|
12
|
+
inheritSkills: false
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Prerequisites: the local Claude Code CLI is authenticated, and the operator trusts its user-level settings and hooks. Analyze only the supplied handoff in no-tools mode. Return a concise final answer with evidence. Do not edit files or request wider access.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-exec-writer
|
|
3
|
+
description: Explicit workspace-writing one-shot execution through the installed Codex CLI
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: codex-exec-writer
|
|
7
|
+
command: codex
|
|
8
|
+
promptDelivery: stdin
|
|
9
|
+
async: true
|
|
10
|
+
systemPromptMode: replace
|
|
11
|
+
inheritProjectContext: true
|
|
12
|
+
inheritSkills: false
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Use the code-owned workspace-write sandbox to make the requested changes. Return a concise final answer with validation evidence. Do not request wider access or additional writable roots.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-exec
|
|
3
|
+
description: Read-only one-shot analysis through the installed Codex CLI
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: codex-exec
|
|
7
|
+
command: codex
|
|
8
|
+
promptDelivery: stdin
|
|
9
|
+
async: true
|
|
10
|
+
systemPromptMode: replace
|
|
11
|
+
inheritProjectContext: true
|
|
12
|
+
inheritSkills: false
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Analyze the task in read-only mode. Return a concise final answer with evidence. Do not edit files or request wider access.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cursor-agent-writer
|
|
3
|
+
description: Explicit workspace-writing one-shot execution through the installed Cursor CLI
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: cursor-agent-writer
|
|
7
|
+
command: cursor-agent
|
|
8
|
+
async: true
|
|
9
|
+
systemPromptMode: replace
|
|
10
|
+
inheritProjectContext: true
|
|
11
|
+
inheritSkills: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Use the code-owned sandbox to make the requested workspace changes. Return a concise final answer with validation evidence. Do not request wider access or additional workspace roots.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cursor-agent
|
|
3
|
+
description: Read-only one-shot analysis through the installed Cursor CLI
|
|
4
|
+
runner:
|
|
5
|
+
type: external-cli
|
|
6
|
+
adapter: cursor-agent
|
|
7
|
+
command: cursor-agent
|
|
8
|
+
async: true
|
|
9
|
+
systemPromptMode: replace
|
|
10
|
+
inheritProjectContext: true
|
|
11
|
+
inheritSkills: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Analyze the task in read-only ask mode. Return a concise final answer with evidence. Do not edit files or request wider access.
|
package/docs/agents.md
CHANGED
|
@@ -55,26 +55,122 @@ If you disabled the old bundled `gpt-pro` workaround with `agentOverrides.gpt-pr
|
|
|
55
55
|
|
|
56
56
|
The Pi async run remains the source of truth for status, artifacts, wake/wait, mission attachment, retention, and diagnostics.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
### Advisory runner data boundary
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
command: claude
|
|
67
|
-
args: ["<verified-read-only-flags>"]
|
|
68
|
-
promptDelivery: stdin
|
|
69
|
-
async: true
|
|
70
|
-
---
|
|
60
|
+
The built-in `codex-exec` and `codex-exec-writer` profiles are the supported Codex one-shot modes. Both require an installed and authenticated Codex CLI. The adapters own `codex exec --json` argv with ignored user config and rules, ephemeral sessions, approval policy `never`, and a final-message artifact.
|
|
61
|
+
|
|
62
|
+
| Profile | Access | Sandbox |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `codex-exec` | Read-only analysis | `read-only` |
|
|
65
|
+
| `codex-exec-writer` | Explicit workspace edits | `workspace-write` |
|
|
71
66
|
|
|
72
|
-
|
|
67
|
+
Neither adapter uses full access, approval or sandbox bypasses, automatic approval review, or additional writable roots. User profiles cannot add argv. The `codex-exec` selection identity is reserved for the read-only adapter.
|
|
68
|
+
|
|
69
|
+
Run it asynchronously:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
Use codex-exec to analyze this change without editing files.
|
|
73
|
+
|
|
74
|
+
Use codex-exec-writer to make the requested workspace changes.
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
The adapter validates `codex --version` and `codex exec --help` only when a run launches. Discovery, list, status, and native Pi launches do not probe Codex. JSONL, stderr, and stdout are untrusted. A run succeeds only after bounded valid JSONL contains one `turn.completed` event and the bounded final-message artifact is present.
|
|
78
|
+
|
|
79
|
+
Maintainers can collect real smoke evidence without making it part of the normal test suite:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
PI_SUBAGENTS_CODEX_EXEC_SMOKE=1 \
|
|
83
|
+
PI_SUBAGENTS_CODEX_EXEC_SMOKE_REPORT=/tmp/pi-subagents-codex-exec-smoke.json \
|
|
84
|
+
node --experimental-strip-types --import ./test/support/register-loader.mjs \
|
|
85
|
+
--test test/integration/codex-exec-smoke.test.ts
|
|
86
|
+
|
|
87
|
+
PI_SUBAGENTS_CODEX_EXEC_WRITER_SMOKE=1 \
|
|
88
|
+
PI_SUBAGENTS_CODEX_EXEC_WRITER_SMOKE_REPORT=/tmp/pi-subagents-codex-exec-writer-smoke.json \
|
|
89
|
+
node --experimental-strip-types --import ./test/support/register-loader.mjs \
|
|
90
|
+
--test test/integration/codex-exec-writer-smoke.test.ts
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The read-only smoke must report `writeCanaryExists: false`. The writer smoke must report `writeCanaryMatches: true`. Both reports include startup duration and terminal proof without raw protocol output, prompts, or credentials.
|
|
94
|
+
|
|
95
|
+
The built-in `claude-code` and `claude-code-writer` profiles are the supported Claude Code one-shot modes. Both require an installed Claude Code CLI that is already authenticated through its normal local login. Claude Code 2.1.150 needs the user setting source for normal OAuth/keychain authentication, so both adapters load user settings but exclude project and local settings. User-level Claude Code settings and hooks are therefore an operator-trusted prerequisite. Review or disable unsafe user hooks before using either profile.
|
|
96
|
+
|
|
97
|
+
| Profile | Access | Permission mode | Built-in tools |
|
|
98
|
+
|---|---|---|---|
|
|
99
|
+
| `claude-code` | Handoff-only read-only advice | `plan` | none |
|
|
100
|
+
| `claude-code-writer` | Explicit workspace file edits | `acceptEdits` | `Read,Write,Edit,Glob,Grep` |
|
|
101
|
+
|
|
102
|
+
Both adapters own `claude -p` argv with stream JSON, strict empty MCP configuration, user-only setting sources, no session persistence, disabled slash commands, and disabled Chrome integration. The writer mode does not include Bash or any permission bypass. Neither mode uses `--bare`, which does not read normal OAuth/keychain authentication. Neither mode requires `--safe-mode`, which is absent from the installed 2.1.150 help. User profiles cannot add argv. Selecting the code-owned `claude-code-writer` adapter identity is the only way to opt into its write tools; the read-only adapter cannot be widened with user argv.
|
|
103
|
+
|
|
104
|
+
Run it asynchronously:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
Use claude-code to analyze this handoff without editing files.
|
|
108
|
+
|
|
109
|
+
Use claude-code-writer to make the requested file changes.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The adapter validates `claude --version` and `claude --help` only when a run launches. Discovery, list, status, and native Pi launches do not probe Claude Code or authentication. JSONL, stderr, and stdout are untrusted. A run succeeds only after bounded valid JSONL contains exactly one successful terminal `result` with non-empty final text. Missing or revoked local authentication, limit stops, malformed JSON, duplicate terminal results, and EOF before a terminal result fail closed.
|
|
113
|
+
|
|
114
|
+
Maintainers can opt in to separate read-only and writer canaries:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
PI_SUBAGENTS_CLAUDE_CODE_SMOKE=1 \
|
|
118
|
+
PI_SUBAGENTS_CLAUDE_CODE_SMOKE_REPORT=/tmp/pi-subagents-claude-code-smoke.json \
|
|
119
|
+
node --experimental-strip-types --import ./test/support/register-loader.mjs \
|
|
120
|
+
--test test/integration/claude-code-smoke.test.ts
|
|
121
|
+
|
|
122
|
+
PI_SUBAGENTS_CLAUDE_CODE_WRITER_SMOKE=1 \
|
|
123
|
+
PI_SUBAGENTS_CLAUDE_CODE_WRITER_SMOKE_REPORT=/tmp/pi-subagents-claude-code-writer-smoke.json \
|
|
124
|
+
node --experimental-strip-types --import ./test/support/register-loader.mjs \
|
|
125
|
+
--test test/integration/claude-code-writer-smoke.test.ts
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Both smoke reports record `authentication: "existing-cli-required"`, `settingSources: "user"`, and `userSettingsTrust: "required"` without recording credential details. For read-only, confirm `terminalState` is `completed` and `writeCanaryExists` is `false`. For writer, confirm `terminalState` is `completed` and `writeCanaryMatches` is `true`. `durationMs` records cold process time. If authentication is missing or revoked, repair the normal local Claude Code login and rerun the smoke. Reports do not contain raw protocol output or credentials.
|
|
129
|
+
|
|
130
|
+
The built-in `cursor-agent` and `cursor-agent-writer` profiles are the supported Cursor CLI one-shot modes. Both require an installed Cursor CLI and either `CURSOR_API_KEY` or an existing local login.
|
|
131
|
+
|
|
132
|
+
| Profile | Access | Cursor mode |
|
|
133
|
+
|---|---|---|
|
|
134
|
+
| `cursor-agent` | Read-only analysis | `ask` |
|
|
135
|
+
| `cursor-agent-writer` | Explicit workspace edits | non-interactive print |
|
|
136
|
+
|
|
137
|
+
Both adapters use stream JSON, the enabled sandbox, and the primary workspace. They write the full handoff to a private `0600` file in a private temporary directory. Process argv contains only a short instruction with that path. The temporary directory is added as a workspace root only when it is outside the primary workspace. The prompt file and directory are removed after completion, failure, or stop.
|
|
138
|
+
|
|
139
|
+
The adapters do not pass force, yolo, auto-review, MCP approval, plugin, session resume, continue, worktree, or workspace trust flags. User profiles cannot add argv or workspace roots. The `cursor-agent` selection identity is reserved for the read-only adapter.
|
|
140
|
+
|
|
141
|
+
Launch preflight validates `cursor-agent --version` and `cursor-agent --help` only when a run starts. Discovery, list, status, and native Pi launches do not execute Cursor or probe authentication. A run succeeds only when bounded valid JSONL ends with one successful `result` event that has non-empty final text. Error events, failed results, malformed JSON, output after the terminal event, and EOF before a result fail closed.
|
|
142
|
+
|
|
143
|
+
These headless smokes rely on saved workspace trust. Cursor documents no passive command that checks workspace trust, so the smoke cannot verify it before launch. The operator must use Cursor's interactive trust flow for the exact disposable workspace and the exact derived prompt directory, `<state-root>/external-0.cursor-prompt`. Keep that prompt directory after the trust step. It must be empty, owned by the operator who runs the smoke, and must not be a symlink. The harness preserves this directory but creates its private handoff with exclusive `0600` access and removes the handoff after every run. Repeat the trust setup if either exact path changes.
|
|
144
|
+
|
|
145
|
+
The smoke requires two existing, separate operator-managed directories and an explicit disposable-workspace attestation:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
export PI_SUBAGENTS_CURSOR_SMOKE_WORKSPACE=/tmp/pi-subagents-cursor-smoke-workspace
|
|
149
|
+
export PI_SUBAGENTS_CURSOR_SMOKE_STATE_ROOT=/tmp/pi-subagents-cursor-smoke-state
|
|
150
|
+
export PI_SUBAGENTS_CURSOR_SMOKE_DISPOSABLE=1
|
|
151
|
+
mkdir -p "$PI_SUBAGENTS_CURSOR_SMOKE_WORKSPACE" "$PI_SUBAGENTS_CURSOR_SMOKE_STATE_ROOT"
|
|
152
|
+
mkdir -p "$PI_SUBAGENTS_CURSOR_SMOKE_STATE_ROOT/external-0.cursor-prompt"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Do not place a file at `pi-subagents-cursor-write-canary.txt` in the workspace or any file, including `handoff.txt`, in the prompt directory. The harness refuses the pre-existing canary and any non-empty prompt directory. It does not delete the workspace, state root, or operator-owned prompt directory. It removes only its canary and private handoff file.
|
|
156
|
+
|
|
157
|
+
Maintainers can then run separate read-only and writer canaries:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
PI_SUBAGENTS_CURSOR_AGENT_SMOKE=1 \
|
|
161
|
+
PI_SUBAGENTS_CURSOR_AGENT_SMOKE_REPORT=/tmp/pi-subagents-cursor-agent-smoke.json \
|
|
162
|
+
node --experimental-strip-types --import ./test/support/register-loader.mjs \
|
|
163
|
+
--test test/integration/cursor-agent-smoke.test.ts
|
|
164
|
+
|
|
165
|
+
PI_SUBAGENTS_CURSOR_AGENT_WRITER_SMOKE=1 \
|
|
166
|
+
PI_SUBAGENTS_CURSOR_AGENT_WRITER_SMOKE_REPORT=/tmp/pi-subagents-cursor-agent-writer-smoke.json \
|
|
167
|
+
node --experimental-strip-types --import ./test/support/register-loader.mjs \
|
|
168
|
+
--test test/integration/cursor-agent-writer-smoke.test.ts
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The read-only smoke must report `writeCanaryExists: false`. The writer smoke must report `writeCanaryMatches: true`. Both reports record `workspaceTrust: "operator-managed-saved"`, confirm that the external prompt root was added, and include startup duration and terminal proof without raw protocol output, prompts, or credentials. A trust-required error remains terminal; the harness does not retry with a trust, force, or yolo flag.
|
|
76
172
|
|
|
77
|
-
Native `oracle` runs inside Pi and can use its configured read tools.
|
|
173
|
+
Native `oracle` runs inside Pi and can use its configured read tools. The Claude profiles send the assembled prompt to the local Claude Code CLI through stdin. An external-job agent sends the assembled prompt to its registered provider. Provider options and a prompt digest are persisted in Pi run state. The prompt text is delivered through the local host bridge to the provider and is not stored in the public result payload. Do not place secrets in advisory prompts unless the target provider is approved to receive them.
|
|
78
174
|
|
|
79
175
|
### External-job state table
|
|
80
176
|
|
package/docs/configuration.md
CHANGED
|
@@ -18,6 +18,18 @@ By default, project settings resolve from the nearest parent directory that cont
|
|
|
18
18
|
|
|
19
19
|
`"git-root"` keeps package discovery, project agents, chains, and `agentOverrides` anchored to the git worktree root when that root also has Pi project config. A nested project can still opt back into nearest-root behavior by setting `"projectRootResolution": "nearest"` in its own `.pi/settings.json`.
|
|
20
20
|
|
|
21
|
+
## `modelExclusions`
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"modelExclusions": {
|
|
26
|
+
"defaultTtlMs": 300000
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Controls the duration, in milliseconds, for model exclusions. The default is `86400000` (24 hours), and the maximum is `8000000000000000` so generated expiry timestamps remain valid JavaScript dates. The extension applies this value when it starts or reloads. A lower configured value shortens active cached exclusions from their original `recordedAt`; it never extends an existing expiry. Launches also warn when a candidate is skipped, including the cached reason and expiry. `PI_MODEL_EXCLUSIONS_PATH` changes the exclusion-store path but does not change this TTL.
|
|
32
|
+
|
|
21
33
|
## `toolDescriptionMode`
|
|
22
34
|
|
|
23
35
|
```json
|
|
@@ -109,6 +121,23 @@ Sets `fresh` or `fork` for every subagent launch that omits `context`. This glob
|
|
|
109
121
|
|
|
110
122
|
With `"fork"`, the setting uses the existing implicit-fork behavior. A launch starts fresh when the parent session file or current leaf is not available. `"fresh"` starts fresh even when the selected agent defaults to fork. Scheduled runs continue to set fresh context explicitly. A runner or provider that does not support fork context keeps its existing rejection behavior.
|
|
111
123
|
|
|
124
|
+
## `forkContext`
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"forkContext": {
|
|
129
|
+
"mode": "pruned",
|
|
130
|
+
"model": "openai-codex/gpt-5.6-luna:max"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Controls how resolved fork launches prepare the inherited session. The default `"full"` mode keeps the complete fork. `"pruned"` mode keeps inherited context exact while it fits the code-owned 64 KiB session budget. On overflow, the required `model` returns short JSON summaries keyed by stable item ids. Tool results spill first, then older assistant and tool context, and user text only when required. It applies to explicit `context: "fork"`, global and agent fork defaults, and `context: "profile"` when the selected profile resolves to fork.
|
|
136
|
+
|
|
137
|
+
Child-visible spilled items contain only the model summary and a stable `{ batchId, itemId }` recovery ref. Raw bodies and their digests, source entry ids, labels, sizes, and tool metadata go to a private `0600` sidecar next to the child session. This release does not add a recovery command or expose that payload to the child model.
|
|
138
|
+
|
|
139
|
+
Pruned forks keep the normal `parentSession` link, child cwd alignment, and fork thinking-block sanitization. Missing model or auth, invalid or incomplete summary JSON, budget overflow, recovery validation failure, and raw overflow leakage all stop the launch before child spawn. The extension never falls back to a full fork or refs-only context after a prune failure.
|
|
140
|
+
|
|
112
141
|
## `fleetView`
|
|
113
142
|
|
|
114
143
|
```json
|
|
@@ -244,6 +273,14 @@ Optionally caps concurrently active top-level async runs owned by one parent ses
|
|
|
244
273
|
|
|
245
274
|
Queued, running, paused, and needs-attention runs retain capacity. Runner-backed slots release only after terminal logical state and matching observed process-terminal proof from #1030. Missing, malformed, or unknown cleanup proof retains the slot. A terminal async workflow releases after its controller is gone and every launched child is accounted for: awaited foreground children are covered by workflow settlement, while actual background children still require observed process-terminal proof. Resume transfers the source slot without a second charge. Dismissal and history cleanup do not release capacity.
|
|
246
275
|
|
|
276
|
+
When the runner is gone but process cleanup proof remains unknown, configure a bounded policy reclaim under `capacity.abandonedSlotReleaseAfterMs`:
|
|
277
|
+
|
|
278
|
+
```json
|
|
279
|
+
{ "maxActiveAsyncRunsPerSession": 4, "capacity": { "abandonedSlotReleaseAfterMs": 1200000 } }
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
The default is `1200000` milliseconds (20 minutes). The policy releases only a failed terminal run whose runner PID is dead and whose last activity is older than the threshold. A live or unknown PID, a non-failed terminal state, a recent run, or missing activity timestamp retains the slot. Set the value to `false` to keep strict retention. Valid configured durations range from 5 minutes through 24 hours. Policy release is reported as `abandoned-timeout` with `processProof: unknown`; it is not observed process-terminal proof and may reclaim capacity while an orphan child still exists.
|
|
283
|
+
|
|
247
284
|
This limit bounds current top-level async load. It is separate from cumulative `maxSubagentSpawnsPerSession`, `maxSubagentSpawnsPerRun`, and `globalConcurrencyLimit`.
|
|
248
285
|
|
|
249
286
|
`subagent({ action: "status" })`, fleet status, and `subagent({ action: "doctor" })` expose used, effective limit, and remaining active capacity. Static chains and parallel calls fail before creating run artifacts or starting partial work when their declared capacity cannot fit. Later retries or unbounded dynamic work are not guaranteed by that preflight.
|
package/docs/extension-api.md
CHANGED
|
@@ -28,7 +28,7 @@ The RPC methods are `ping`, `status`, `manage`, `spawn`, `steer`, `interrupt`, `
|
|
|
28
28
|
Method notes:
|
|
29
29
|
|
|
30
30
|
- `manage` exposes a narrow schedule-only allowlist: `schedule.list`, `schedule.show`, `schedule.history`, `schedule.pause`, `schedule.resume`, `schedule.run`, and `schedule.delete`. All actions except `schedule.list` require `id`. Mission, agent, config, worktree, and arbitrary management actions are rejected before executor dispatch. `ping.capabilities.managementActions` advertises the exact allowlist.
|
|
31
|
-
- `spawn` accepts structured single-child execution (`agent`, `task?`)
|
|
31
|
+
- `spawn` accepts structured single-child execution (`agent`, `task?`), inline `workflowScript`, or `workflowScriptPath` and is async-only: omit `async` or set `async: true`, omit `clarify`, and do not pass management `action` values. Relative script paths resolve against the request `cwd`. It goes through the same executor as the `subagent` tool, so agent discovery, validation, session attribution, configured spawn caps, child-safety depth, artifacts, and async status all behave the same.
|
|
32
32
|
- `steer` requires an async run `id` (plus optional child `index`) and a non-empty `message`; its reply preserves the normal acknowledged-delivery result. Optional `mode` values are `steer` (default), `follow_up`, and `auto`, and receipts include `deliveryStatus: "delivered" | "queued"`. RPC steering disables the direct tool's pause-and-revive recovery in every mode so an extension keeps authority over the exact child it spawned; `ping.capabilities.nonRecoveringSteer` advertises this guarantee.
|
|
33
33
|
- `resume` requires a run target and non-empty `message`. It delegates to the existing revival path, which validates current-session ownership, persisted session/recovery metadata, stopped/live state, capability ceilings, and the exclusive session lease before returning the new async run details. Callers may request a `file-only` output path for the revived result without overriding its model, tools, or budgets. `ping.capabilities.resume` advertises this seam.
|
|
34
34
|
- `stop` targets current-session top-level async runs through the stop control channel and records a `stopped` lifecycle instead of reporting a timeout.
|
|
@@ -295,7 +295,7 @@ When Pi runs inside [Herdr](https://herdr.dev), pi-subagents automatically repor
|
|
|
295
295
|
- The bridge is enabled only when Herdr supplies `HERDR_ENV=1` and `HERDR_PANE_ID`; outside Herdr it registers no listeners or timers.
|
|
296
296
|
- It restores current-session active runs after `/reload` or `/resume`, refreshes metadata while work is active, and clears it on completion or shutdown.
|
|
297
297
|
- The bridge uses Herdr's existing `herdr:blocked` sibling event when an async child needs attention, and emits `herdr:busy` while async work remains. Herdr versions that support the sibling event keep the pane's semantic state `working`; older versions ignore it safely and still display the metadata label while the Pi integration remains the lifecycle authority.
|
|
298
|
-
- The owning Pi session is the only publisher for its own pane metadata.
|
|
298
|
+
- The owning Pi session is the only publisher for its own pane metadata. When an active workflow has an explicit bounded `label`, the newest active label appears in the summary and compact `title-suffix`; overlapping completion restores the previous active label. Raw task and goal prompts never enter Herdr metadata. Without a label, one active run uses its agent name and two or more use the active-run count. Attention adds `⚠`, and the suffix is cleared when active work reaches zero.
|
|
299
299
|
|
|
300
300
|
To show the reported label in the expanded Agent sidebar, include `state_text` or `$summary` in its row layout:
|
|
301
301
|
|
package/docs/models.md
CHANGED
|
@@ -60,6 +60,12 @@ For a persistent role override with a backup model for provider failures:
|
|
|
60
60
|
|
|
61
61
|
`subagents.defaultModel` and `subagents.defaultProvider` apply to builtin, package, user, and project agents. `defaultModel` fills only agents that do not set `model` in frontmatter. `defaultProvider` is also applied to frontmatter and override models so bare ids resolve against the intended provider. Per-run model overrides and `agentOverrides.<name>.model` still win, and explicit agent frontmatter still wins over the global default. The same `agentOverrides` block can change `tools`, `skills`, inherited context, prompt text, or disable a builtin (see [agents.md](agents.md)). Matching user and project agents also receive override fields that their frontmatter leaves unset, so a shared project config agent can keep the persona while local settings choose the model or provider.
|
|
62
62
|
|
|
63
|
+
## Fast mode
|
|
64
|
+
|
|
65
|
+
Set `fast: true` on a run, in agent frontmatter, or in `subagents.agentOverrides.<name>.fast` to request the OpenAI priority service tier for supported native OpenAI-Codex children. This can use a higher quota tier or cost more. It is off by default.
|
|
66
|
+
|
|
67
|
+
Fast mode fails before launch unless every resolved model candidate is on the allowlist. The current allowlist is `openai-codex/gpt-5.6-luna` and `openai-codex/gpt-5.6-sol`. External runners, Anthropic models, and other providers do not use fast mode.
|
|
68
|
+
|
|
63
69
|
## Recommended model tiering (optional)
|
|
64
70
|
|
|
65
71
|
A setup that works well in practice: route agents by task shape instead of running everything on one model. Four tiers:
|
package/docs/observability.md
CHANGED
|
@@ -6,9 +6,9 @@ Where running subagents show up, how to inspect them, and the files and events t
|
|
|
6
6
|
|
|
7
7
|
Foreground runs stream progress in the conversation while they run. They default to a generous 30-minute wall-clock timeout when neither the call nor the selected agent provides a timeout; a global [`timeoutMs`](configuration.md#timeoutms) config replaces that default, and explicit `timeoutMs`/`maxRuntimeMs` and agent defaults win.
|
|
8
8
|
|
|
9
|
-
Live progress shows compact detail for single, chain, and parallel modes: current tool, recent output, token counts, aggregate cost, duration, activity freshness, current-tool duration, and chain graph metadata when available.
|
|
9
|
+
Live progress shows compact detail for single, chain, and parallel modes: a bounded one-line task, current tool, recent output, token counts, aggregate cost, duration, activity freshness, current-tool duration, and chain graph metadata when available. Workflow `label` metadata wins over raw task text in compact multi-child cards.
|
|
10
10
|
|
|
11
|
-
Press Pi's configured expand key (`Ctrl+O` by default) to expand the full streaming view with complete output per step.
|
|
11
|
+
Press Pi's configured expand key (`Ctrl+O` by default) to expand the full streaming view with complete output per step. Running-card hints also advertise `Ctrl+Alt+F` for the Fleet inspector.
|
|
12
12
|
|
|
13
13
|
Sequential chains show a flow line like `done scout → running worker`. Chains with parallel steps show per-step cards instead. Chain status uses `label` and `phase` metadata when present, while falling back to agent names for older chains.
|
|
14
14
|
|
|
@@ -29,8 +29,9 @@ The under-editor async widget gives a short view while work runs. Its expand key
|
|
|
29
29
|
async subagent worker · background
|
|
30
30
|
● worker
|
|
31
31
|
● Step 1/1: worker · running
|
|
32
|
+
task: Review authentication boundaries
|
|
32
33
|
⎿ read: src/auth.ts | 2.0s
|
|
33
|
-
Press configured-expand-key for live detail
|
|
34
|
+
Press configured-expand-key for live detail · Ctrl+Alt+F Fleet
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
To inspect one background child in text, use `subagent({ action: "status", id: "...", view: "transcript" })`; add `index` for a specific child in a parallel or chain run.
|
|
@@ -40,7 +41,7 @@ To inspect one background child in text, use `subagent({ action: "status", id: "
|
|
|
40
41
|
In the TUI, a persistent FleetView below the editor keeps active work visible as a compact summary. Set `fleetViewPlacement` to `"aboveEditor"` to move it above the editor.
|
|
41
42
|
|
|
42
43
|
```text
|
|
43
|
-
2 active agents · 1 pane · ↓ 4.2k
|
|
44
|
+
2 active agents · 1 pane · ↓ 3.1k window · 4.2k spent · ↓/← to inspect
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
After you expand it:
|
|
@@ -49,11 +50,11 @@ After you expand it:
|
|
|
49
50
|
↑↓/jk select · enter inspect · esc back
|
|
50
51
|
|
|
51
52
|
> main
|
|
52
|
-
scout · running
|
|
53
|
-
reviewer · running
|
|
53
|
+
scout · running 1m 12s · ↓ 2.0k window · 2.8k spent
|
|
54
|
+
reviewer · running 38s · ↓ 1.1k window · 1.4k spent
|
|
54
55
|
```
|
|
55
56
|
|
|
56
|
-
When the focused editor is empty, press `↓` or `←` to expand the summary into `main` plus active children with agent name, state, elapsed time, and token
|
|
57
|
+
When the focused editor is empty, press `↓` or `←` to expand the summary into `main` plus active children with agent name, state, elapsed time, and token usage. When providers report usage, `window` is the latest assistant turn's input plus cache-read tokens, while `spent` keeps the cumulative input-plus-output total. Old run artifacts without window data keep the existing token-total label. The compact line counts active current-session work and Herdr project panes. Then use `↑`/`↓` or `j`/`k` to select a child and `Enter` to inspect it. Printable navigation keys are never intercepted before activation.
|
|
57
58
|
|
|
58
59
|
FleetView replaces the legacy above-editor async widget by default. Successful background completions stay quiet so inactive Pi tabs are not marked unread, while failed or paused completions still notify the originating session. Parallel runs show every active child independently. Chains with parallel groups keep their grouped shape in progress and results, so failed or paused agents stay visible next to completed ones. When a child is explicitly allowed to fan out with `tools: subagent`, its nested runs appear under that parent child in the main status tree instead of being hidden inside the child process.
|
|
59
60
|
|
package/docs/tool-reference.md
CHANGED
|
@@ -6,6 +6,16 @@ Parameters and actions for the `subagent` tool. These are what the LLM passes wh
|
|
|
6
6
|
|
|
7
7
|
Chaining is code-driven through `workflowScript`. Use `await runs.run(...)` for sequential steps and `await runs.all([{ key, agent, task }, ...])` for ordinary parallel fanout. `runs.all` resolves to an ordered array, not a key map, so use indexes, destructuring, or `.map(...)`, not `results.<key>`. Do not read `.output` from an unawaited `runs.run` launch. Stored `runs.run` promises are only for the advanced rolling fanout pattern under [Workflow steering](#workflow-steering), where every promise is later observed with direct `await`, `Promise.race`, or `Promise.all`. Legacy top-level `chain`, `tasks`, and `parallel` inputs are not supported. Helper functions must be plain functions or explicit Promise chains. Nested `async function` helpers, async arrows, and async methods are rejected so child-launch tracking stays portable across Node and Bun.
|
|
8
8
|
|
|
9
|
+
Use `{ action: "validate", workflowScript }` to check statically decidable syntax and structure without launching children. It returns `{ ok, errors }` and fails the tool call when `ok` is false. Dynamic keys and values remain valid because runtime-only cases are not guessed.
|
|
10
|
+
|
|
11
|
+
Use `workflowScriptPath` instead of `workflowScript` to load the same JavaScript statement body from a file. The two fields are mutually exclusive. Relative paths resolve against the request `cwd`, and absolute paths pass through. The host reads the file before validation, scheduling, or sandbox execution. The workflow sandbox still has no filesystem access. Missing, unreadable, and empty files fail as file input errors.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
{ workflowScriptPath: "workflows/review.js", cwd: "/path/to/project" }
|
|
15
|
+
{ action: "validate", workflowScriptPath: "workflows/review.js" }
|
|
16
|
+
{ action: "schedule.create", every: "6h", workflowScriptPath: "workflows/review.js" }
|
|
17
|
+
```
|
|
18
|
+
|
|
9
19
|
```js
|
|
10
20
|
// One child; return the child promise explicitly
|
|
11
21
|
{ workflowScript: `return runs.run("main", { agent: "scout", task: "Analyze the auth flow" })` }
|
|
@@ -31,7 +41,7 @@ Chaining is code-driven through `workflowScript`. Use `await runs.run(...)` for
|
|
|
31
41
|
| Param | Type | Default | Description |
|
|
32
42
|
|-------|------|---------|-------------|
|
|
33
43
|
| `agent` | string | - | Agent target for management actions. Workflow child agents are set inside `runs.run` or `runs.all`. |
|
|
34
|
-
| `action` | string | - |
|
|
44
|
+
| `action` | string | - | Offline workflow `validate`, agent management (including `guide`, `children.list`, and `refine`/`refine.show`/`refine.rollback`), mission (`mission.create/list/show/update/resolve-decision/attach-run/close`), Herdr inspector (`inspector.open/status/close`), Herdr project pane (`project.open/status/close`), status/control, schedule, watchdog, or doctor action. |
|
|
35
45
|
| `topic` | `overview \| workflows \| agents \| missions \| observability \| tool-reference \| configuration \| models \| watchdog \| extension-api` | `overview` | Packaged guide topic for `action: "guide"`. |
|
|
36
46
|
| `config` | object/string | - | Agent config for management create/update. |
|
|
37
47
|
| `context` | `fresh \| fork` | global or per-agent default, else `fresh` | Explicit `fresh` or `fork` overrides every workflow child. When omitted, [`defaultSubagentContext`](configuration.md#defaultsubagentcontext) wins over each agent's `defaultContext`; `"fork"` creates a real branched session when the parent session file and current leaf exist, otherwise it falls back to `fresh`. Packaged `worker`, `oracle`, and `advisor` default to `fork`. |
|
package/docs/workflows.md
CHANGED
|
@@ -39,6 +39,26 @@ All model-facing subagent execution is expressed through `workflowScript` in the
|
|
|
39
39
|
|
|
40
40
|
Child results cross into the script as plain JSON data. Non-JSON host metadata is omitted, so use returned fields such as `runId`, `ok`, `output`, and `structuredOutput` for workflow control.
|
|
41
41
|
|
|
42
|
+
Validate a script without launching children:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
subagent({ action: "validate", workflowScript: `
|
|
46
|
+
const results = await runs.all([{ key: "scan", agent: "scout", task: "Scan" }]);
|
|
47
|
+
return results[0].output;
|
|
48
|
+
` });
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For a script stored in a file, use `workflowScriptPath` instead of `workflowScript`:
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
subagent({ workflowScriptPath: "workflows/review.js", cwd: "/path/to/project" });
|
|
55
|
+
subagent({ action: "validate", workflowScriptPath: "workflows/review.js" });
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The fields are mutually exclusive. Relative paths resolve against the request `cwd`; absolute paths pass through. The host reads the file before validation, schedule creation, or workflow sandbox execution. The sandbox still has no filesystem access. Missing, unreadable, and empty files return file input errors instead of script syntax errors.
|
|
59
|
+
|
|
60
|
+
The result is `{ ok, errors }`. Invalid scripts return a tool error and include line and column data when available. Validation checks syntax, portable nested-async rules, literal `runs.run` and `runs.all` keys, duplicate literal keys in one `runs.all` group, direct keyed access to a known `runs.all` result, and statically clear non-JSON boundary values. Dynamic keys and other runtime-only values are accepted without a warning. Validation does not discover agents, launch children, or create run artifacts.
|
|
61
|
+
|
|
42
62
|
```js
|
|
43
63
|
subagent({ workflowScript: `
|
|
44
64
|
const scan = await runs.run("scan", { agent: "scout", task: "Scan the codebase" });
|
package/package.json
CHANGED
|
@@ -93,7 +93,7 @@ return runs.run("cross-oracle", {
|
|
|
93
93
|
});
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
Keyed resume reads that one exact receipt and revalidates the retained run at launch. It fails when the workflow or key is missing, the receipt is stale, `latest` is not `true`, or the recorded child is no longer resumable. Foreground workflow results expose the same receipt in `details.workflow.receipt`, but cross-workflow keyed lookup requires the durable receipt from an async workflow.
|
|
96
|
+
Keyed resume reads that one exact receipt and revalidates the retained run at launch. It fails when the workflow or key is missing, the receipt is stale, `latest` is not `true`, or the recorded child is no longer resumable. The receipt is terminal-only: if `status.json` or `events.jsonl` exists without it, the workflow may still be active or terminal receipt writing may have failed. Use direct child run IDs from status/events for direct resume after the normal retained-child checks; do not reconstruct keyed entries from those files. Foreground workflow results expose the same receipt in `details.workflow.receipt`, but cross-workflow keyed lookup requires the durable receipt from an async workflow.
|
|
97
97
|
|
|
98
98
|
### Async/background
|
|
99
99
|
|