@bermudi/pi-delegate 0.1.18 → 0.1.19
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/README.md +14 -13
- package/agents.ts +1 -1
- package/concurrency.ts +7 -0
- package/delegate.ts +6 -0
- package/dispatch.ts +460 -163
- package/extension.ts +35 -26
- package/format.ts +4 -1
- package/host.ts +1 -1
- package/isolated-workspace.ts +154 -8
- package/lifecycle.ts +31 -20
- package/manual.ts +11 -7
- package/package.json +2 -1
- package/parent-context.ts +1 -1
- package/pool.ts +492 -428
- package/render-branches.ts +2 -1
- package/render-result.ts +6 -0
- package/runtime.ts +36 -0
- package/schema.ts +22 -13
- package/status.ts +24 -11
- package/task-resolution.ts +12 -9
- package/test-harness.ts +81 -0
- package/ticket-format.ts +4 -3
- package/tickets.ts +672 -576
- package/types.ts +19 -0
- package/workspace.ts +58 -27
package/manual.ts
CHANGED
|
@@ -110,7 +110,7 @@ export function getSubagentManualMarkdown(
|
|
|
110
110
|
'delegate({ tasks: [{ agent: "default", prompt: "Investigate the auth module" }] })',
|
|
111
111
|
"```",
|
|
112
112
|
"",
|
|
113
|
-
|
|
113
|
+
"Delegate subagents to execute tasks in parallel. Each subagent gets an independent conversation. Start with a built-in agent and its defaults: set only `agent` and `prompt`. Overlapping shared writers in one call run in task order.",
|
|
114
114
|
"",
|
|
115
115
|
"The three handles have different lifetimes:",
|
|
116
116
|
"",
|
|
@@ -138,9 +138,11 @@ export function getSubagentManualMarkdown(
|
|
|
138
138
|
"",
|
|
139
139
|
...builtinLines,
|
|
140
140
|
"",
|
|
141
|
-
"
|
|
141
|
+
"Start with a built-in and its configured defaults. Set only `agent` and `prompt`; omit `model`, `thinking`, `tools`, and `workspace` unless the user requests an override or a concrete task requirement makes the built-in default unsuitable.",
|
|
142
142
|
"",
|
|
143
|
-
"
|
|
143
|
+
"Prefer `default` for general work: it is the only built-in guaranteed to run the parent's exact model and thinking. `scout`/`coder`/`reviewer` apply any configured delegate.json tiers (`agentOverrides`, `agentOverridesByParentModel`) and may run a different model or thinking level than the parent. `scout` is read-only; `coder` and `reviewer` use the shared workspace unless overridden. Choose a specialist for its role, not its name.",
|
|
144
|
+
"",
|
|
145
|
+
"Fresh built-ins inherit the parent's exact model object and thinking level. A same-named Markdown file can override any built-in (first definition wins); an explicit `model` or `thinking` in that file replaces parent inheritance. Task-level `model`/`thinking`/`tools` always win. For `scout`/`coder`/`reviewer`, delegate.json overrides (`agentOverrides`, `agentOverridesByParentModel`) win over the Markdown file; `default` ignores overrides and uses only an explicit Markdown `model`/`thinking` when present. A prompt-only Markdown override keeps the built-in's tools and workspace, so `scout` stays read-only and `reviewer` stays shared unless the file explicitly changes them. Parent extension/MCP tools are not copied. Parent-global `AGENTS.md` instructions are also excluded. Project-local context and skills are rebuilt for the task's `cwd`; per-task fields remain explicit overrides.",
|
|
144
146
|
"",
|
|
145
147
|
"## Available Custom Agents",
|
|
146
148
|
"",
|
|
@@ -234,16 +236,18 @@ export function getSubagentManualMarkdown(
|
|
|
234
236
|
"",
|
|
235
237
|
`See the field tables above for the full semantics. Max ${getMaxAsyncTickets()} concurrent async tickets.`,
|
|
236
238
|
"Async results arrive as follow-up messages, so Pi cannot fold their usage into the parent session total; displayed task usage remains informational.",
|
|
239
|
+
'Isolation supports sync or async one-shot `workspace: "isolated"` tasks. In async mode it prepares Git worktrees after returning the ticket, runs one-shot workers, then reconciles successful proposals in task order before settling. Cancellation never applies unfinished work; a completed proposal cancelled before source application is retained as a private ref and full patch.',
|
|
237
240
|
"",
|
|
238
241
|
"## Gotchas",
|
|
239
242
|
"",
|
|
240
243
|
"- Dispatch validation is batch-wide and runs before spawning: one invalid task rejects the call without starting its siblings.",
|
|
241
|
-
|
|
244
|
+
"- Shared writers overlapping within one call are serialized in task order (reported in the result); overlap with a running sync/async dispatch is rejected, so wait for it to finish. Unknown tools count as mutating.",
|
|
242
245
|
"- `*` means read/write/edit/bash, not every tool. `grep`, `find`, and `ls` are valid explicit tools and are the `ro` preset.",
|
|
243
246
|
'- `tasks` is an array. The tool recovers common stringified calls for compatibility, but canonical calls use `{ tasks: [{ prompt: "..." }] }`.',
|
|
244
|
-
|
|
245
|
-
"- Omit `thinking` for
|
|
246
|
-
"-
|
|
247
|
+
"- Use a built-in agent first: `default` for general work, `scout` for read-only investigation, `coder` for implementation, and `reviewer` for review. Omitting `agent` creates a custom inline task rather than selecting a default.",
|
|
248
|
+
"- Omit `model`, `thinking`, `tools`, and `workspace` for built-ins unless the user requests an override or the built-in default cannot satisfy a concrete requirement. These task fields replace configured policy.",
|
|
249
|
+
"- In particular, setting `thinking` overrides the agent's configured thinking budget. A casual effort value silently defeats that budget; leave it unset rather than estimating effort for every task.",
|
|
250
|
+
"- An inline task with no `tools` uses `*`; a named custom task uses its profile; a profile with no tools uses `*`.",
|
|
247
251
|
"- Subagents inherit all skills discovered in their `cwd` (via AgentSession's resource loader). Per-task skill filtering is not supported — curate the cwd's skill set instead.",
|
|
248
252
|
`- Sync \`delegate\` runs at most ${getMaxConcurrent()} tasks at once (the rest queue, not fail). Use \`async: true\` to move work to the background.`,
|
|
249
253
|
"- `deadlineMs` is a per-task wall-clock budget measured from when the task starts running (after queuing). It requests cooperative abort and is not a hard kill; completed writes/commands remain. Omission disables the deadline.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bermudi/pi-delegate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Delegate tool for the Pi coding agent.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@earendil-works/pi-coding-agent": "^0.84.2",
|
|
29
29
|
"@earendil-works/pi-tui": "^0.84.2",
|
|
30
30
|
"@marcfargas/pi-test-harness": "^0.6.1",
|
|
31
|
+
"@types/bun": "^1.4.0",
|
|
31
32
|
"esbuild": "^0.28.2",
|
|
32
33
|
"prettier": "^3.9.6",
|
|
33
34
|
"typescript": "^5.9.3"
|
package/parent-context.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
/** Render the active parent conversation as compact context for a subagent. */
|
|
7
7
|
export function buildParentTranscript(
|
|
8
8
|
entries: SessionEntry[],
|
|
9
|
-
leafId: string | null,
|
|
9
|
+
leafId: string | null | undefined,
|
|
10
10
|
): string | null {
|
|
11
11
|
try {
|
|
12
12
|
const ctx = buildSessionContext(entries, leafId);
|