Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The installed extension generates this compact index from its executable capabil
<!-- BEGIN GENERATED SUPPORTED WORKFLOW CAPABILITIES -->
| Name | Classification | Signature | Options and defaults |
| --- | --- | --- | --- |
| agent | runtime-global | `agent(prompt, options?) => Promise<string \| structured value \| null>` | `label`: string (optional; default: derived from phase and call count)<br>`phase`: string (optional; default: current phase)<br>`schema`: plain JSON Schema (optional)<br>`model`: string (optional)<br>`tier`: string (optional)<br>`isolation`: "worktree" (optional)<br>`agentType`: string (optional)<br>`timeoutMs`: number \| null (optional; default: run timeout; null disables)<br>`retries`: number (optional; default: run retry count) |
| agent | runtime-global | `agent(prompt, options?) => Promise<string \| structured value \| null>` | `label`: string (optional; default: derived from phase and call count)<br>`phase`: string (optional; default: current phase)<br>`schema`: plain JSON Schema (optional)<br>`model`: string (optional)<br>`tier`: string (optional)<br>`isolation`: "worktree" (optional)<br>`thread`: string (optional)<br>`agentType`: string (optional)<br>`timeoutMs`: number \| null (optional; default: run timeout; null disables)<br>`retries`: number (optional; default: run retry count) |
| parallel | runtime-global | `parallel(thunks) => Promise<Array<unknown \| null>>` | — |
| pipeline | runtime-global | `pipeline(items, ...stages) => Promise<Array<unknown \| null>>` | — |
| workflow | runtime-global | `workflow(savedName, childArgs?) => Promise<unknown>` | — |
Expand Down Expand Up @@ -250,7 +250,7 @@ Extension state lives outside the repository under `~/.pi/workflows`:
- project runs, journals, locks, and saved overrides: `~/.pi/workflows/projects/<project>/`
- older project-local `.pi/workflows/runs` and `.pi/workflows/saved` remain readable as fallbacks

Subagents are in-memory by default. Set `persistAgentSessions: true` to retain full transcripts in Pi's standard session directory. This creates one file per agent and may store sensitive material that an agent read, so enable it deliberately.
Subagents are in-memory by default. Set `persistAgentSessions: true` to retain full transcripts in Pi's standard session directory. This creates one file per unthreaded call or named thread and may store sensitive material that an agent read, so enable it deliberately.

Completed background runs persist their full result in the project run JSON. The conversation delivery includes a pointer to that file when the visible summary is shortened.

Expand Down
2 changes: 1 addition & 1 deletion docs/workflow-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See [Workflow prompt guidance rationale](workflow-prompt-guidance-rationale.md)
<!-- BEGIN GENERATED SUPPORTED WORKFLOW CAPABILITIES -->
| Name | Classification | Signature | Options and defaults |
| --- | --- | --- | --- |
| agent | runtime-global | `agent(prompt, options?) => Promise<string \| structured value \| null>` | `label`: string (optional; default: derived from phase and call count)<br>`phase`: string (optional; default: current phase)<br>`schema`: plain JSON Schema (optional)<br>`model`: string (optional)<br>`tier`: string (optional)<br>`isolation`: "worktree" (optional)<br>`agentType`: string (optional)<br>`timeoutMs`: number \| null (optional; default: run timeout; null disables)<br>`retries`: number (optional; default: run retry count) |
| agent | runtime-global | `agent(prompt, options?) => Promise<string \| structured value \| null>` | `label`: string (optional; default: derived from phase and call count)<br>`phase`: string (optional; default: current phase)<br>`schema`: plain JSON Schema (optional)<br>`model`: string (optional)<br>`tier`: string (optional)<br>`isolation`: "worktree" (optional)<br>`thread`: string (optional)<br>`agentType`: string (optional)<br>`timeoutMs`: number \| null (optional; default: run timeout; null disables)<br>`retries`: number (optional; default: run retry count) |
| parallel | runtime-global | `parallel(thunks) => Promise<Array<unknown \| null>>` | — |
| pipeline | runtime-global | `pipeline(items, ...stages) => Promise<Array<unknown \| null>>` | — |
| workflow | runtime-global | `workflow(savedName, childArgs?) => Promise<unknown>` | — |
Expand Down
16 changes: 8 additions & 8 deletions docs/workflow-context-surfaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"workflowAuthoringSkillCorpus": {
"serialization": "sum of UTF-8 bytes for every file under skills/workflow-authoring",
"files": 28,
"bytes": 73626
"bytes": 74599
},
"representativeAuthoringProfiles": {
"serialization": "sum of UTF-8 bytes for each profile's declared package-relative files",
"medianBytes": 12366,
"medianBytes": 12917,
"profiles": [
{
"name": "write",
Expand All @@ -54,7 +54,7 @@
"skills/workflow-authoring/examples/fan-out-and-synthesize.js",
"skills/workflow-authoring/examples/structured-output.js"
],
"bytes": 12260
"bytes": 12811
},
{
"name": "edit",
Expand All @@ -66,7 +66,7 @@
"skills/workflow-authoring/examples/phased-budgets.js",
"skills/workflow-authoring/examples/saved-nested-workflows.js"
],
"bytes": 16972
"bytes": 17523
},
{
"name": "review",
Expand All @@ -77,7 +77,7 @@
"skills/workflow-authoring/references/quality-helpers.md",
"skills/workflow-authoring/examples/adversarial-verification.js"
],
"bytes": 11106
"bytes": 11657
},
{
"name": "debug",
Expand All @@ -88,7 +88,7 @@
"skills/workflow-authoring/references/specialized-helpers.md",
"skills/workflow-authoring/examples/validated-gate.js"
],
"bytes": 12472
"bytes": 13023
},
{
"name": "loop",
Expand All @@ -101,7 +101,7 @@
"skills/workflow-authoring/examples/loop-until-done.js",
"skills/workflow-authoring/examples/structured-output.js"
],
"bytes": 17508
"bytes": 18059
},
{
"name": "retry",
Expand All @@ -113,7 +113,7 @@
"skills/workflow-authoring/examples/bounded-semantic-retry.js",
"skills/workflow-authoring/examples/structured-output.js"
],
"bytes": 11238
"bytes": 11789
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion docs/workflow-guidance-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"algorithm": "sha256",
"surfaces": {
"compactGuidance": "7c699635fe8677afdcb3b57fddc457ea68f9250ef4b4413dc6f385dc1b910d48",
"detailedProse": "12b7410148045c90edecdc22e113b40d863b5ad4d23844ea204632e454960400"
"detailedProse": "155acccb7e3003543f5263d7f7ea3f52b873248e82f37d9d7860f7a1952c0c81"
}
}
2 changes: 1 addition & 1 deletion skills/workflow-authoring/references/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This compact generated index covers supported runtime globals and workflow-tool
<!-- BEGIN GENERATED SUPPORTED WORKFLOW CAPABILITIES -->
| Name | Classification | Signature | Options and defaults |
| --- | --- | --- | --- |
| agent | runtime-global | `agent(prompt, options?) => Promise<string \| structured value \| null>` | `label`: string (optional; default: derived from phase and call count)<br>`phase`: string (optional; default: current phase)<br>`schema`: plain JSON Schema (optional)<br>`model`: string (optional)<br>`tier`: string (optional)<br>`isolation`: "worktree" (optional)<br>`agentType`: string (optional)<br>`timeoutMs`: number \| null (optional; default: run timeout; null disables)<br>`retries`: number (optional; default: run retry count) |
| agent | runtime-global | `agent(prompt, options?) => Promise<string \| structured value \| null>` | `label`: string (optional; default: derived from phase and call count)<br>`phase`: string (optional; default: current phase)<br>`schema`: plain JSON Schema (optional)<br>`model`: string (optional)<br>`tier`: string (optional)<br>`isolation`: "worktree" (optional)<br>`thread`: string (optional)<br>`agentType`: string (optional)<br>`timeoutMs`: number \| null (optional; default: run timeout; null disables)<br>`retries`: number (optional; default: run retry count) |
| parallel | runtime-global | `parallel(thunks) => Promise<Array<unknown \| null>>` | — |
| pipeline | runtime-global | `pipeline(items, ...stages) => Promise<Array<unknown \| null>>` | — |
| workflow | runtime-global | `workflow(savedName, childArgs?) => Promise<unknown>` | — |
Expand Down
4 changes: 4 additions & 0 deletions skills/workflow-authoring/references/capability-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ Every exact fact below is projected from the installed extension's capability co
- `model`: string (optional; highest-priority exact model selector)
- `tier`: string (optional; configured route name; dynamic reference: model-routes)
- `isolation`: "worktree" (optional)
- `thread`: string (optional; non-empty name; same-name calls must be sequential)
- `agentType`: string (optional; must come from provided context; dynamic reference: agent-types)
- `timeoutMs`: number | null (optional; default: run timeout; null disables)
- `retries`: number (optional; default: run retry count; finite values are floored and clamped to 0..3)
- Constraint: recoverable failures return null after retries; nonrecoverable failures throw
- Constraint: schema noncompliance after bounded structured-output repair is nonrecoverable and bypasses agent retries
- Constraint: per-agent retries override invocation retries; retries are floored and clamped to 0..3
- Constraint: resume replays only the longest unchanged prefix; the first miss and every later call execute live
- Constraint: a named thread retains its full Pi transcript and session identity only within one uninterrupted workflow invocation
- Constraint: threaded calls are live-execution resume barriers and are never journaled
- Constraint: same-thread calls must be sequential; threads cannot use worktree isolation
- Constraint: selector priority is explicit model > agentType model > tier > phase model > metadata model > implicit medium > session default
- Constraint: an explicit model, agentType model, tier, or phase model that resolves to an unavailable model throws MODEL_NOT_FOUND naming the source (e.g. the tier and what it resolved to) instead of falling back
- Constraint: only the implicit default medium tier (no explicit model, tier, agentType, or phase model requested) degrades to the session default when unavailable, logging a one-time run-visible warning instead of throwing
Expand Down
2 changes: 2 additions & 0 deletions skills/workflow-authoring/references/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The runtime supplies `agent`, `parallel`, `pipeline`, `workflow`, quality/contro

Call `agent(prompt, { label, schema? })`; it returns text, a schema-validated value, or recoverable `null`. Nonrecoverable limit, validation, and budget failures throw. Record each intended work ID before filtering. A `null` means missing coverage, never a negative finding.

Use `agent(prompt, { thread: "implementer" })` when the same subagent must receive a later follow-up with its complete conversation intact, such as implementer → separate reviewer → implementer revision. Reuse a thread name sequentially; never put same-thread calls in one `parallel()` batch. Nested workflows share thread names with their parent. Threads exist only during the current uninterrupted workflow invocation, cannot use worktree isolation, and restart from the beginning after pause/resume because threaded results are not journaled.

When JavaScript reads fields, pass a small plain JSON Schema. Schema noncompliance after repair throws and bypasses agent retries. Catch it only to return an explicit incomplete outcome without reading missing fields. Return objects, arrays, strings, numbers, booleans, and `null`—not functions, promises, cycles, `BigInt`, or runtime handles.

## Routing and support
Expand Down
Loading