Skip to content
Merged
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
3 changes: 0 additions & 3 deletions extensions/pi-subagents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Spawn one child Pi process. This is the only exposed model-callable tool.
```ts
spawn_subagent({
task: string,
timeout?: number,
cwd?: string,
model?: string
})
Expand All @@ -23,8 +22,6 @@ spawn_subagent({
- You will be notified when the subagent completes.
- The returned ID is also the child Pi session ID and can be used with Pi session lookup/resume behavior.
- `model` is an explicit override; omitting it inherits the active parent provider/model.
- `timeout` is optional (default 600s = 10 minutes) and measured in seconds. When reached, the parent is informed that the child is still running; the child is **not killed**.
- Give `timeout` a healthy margin above expected runtime because child execution time can be wildly unpredictable.
- Subagents always start with fresh session history. Put any desired context explicitly in `task`.
- Child subagent directories contain separate `result.log`, `stdout.log`, and `stderr.log` files.

Expand Down
19 changes: 3 additions & 16 deletions extensions/pi-subagents/skills/pi-subagents/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ Use this tool to launch unrestricted child Pi sessions. The caller must include

## Tools

- `spawn_subagent({ task, timeout?, cwd?, model? })`
- `spawn_subagent({ task, cwd?, model? })`
- Calls return immediately; the parent will be notified when the subagent completes.
- `model` is an explicit override; omitting it inherits the active parent provider/model.
- `timeout` is optional; default is `600` seconds (10 minutes).
- Timeout is only a notification threshold: the parent is informed that the child is still running; the child is not killed.
- The returned subagent id is also the child Pi session id.
- Child output is written to `result.log` under the child subagent directory.
- When `model` is omitted, the child inherits the parent session's active model (e.g., `openai-codex/gpt-5.6-sol`). Pass an explicit `model` to override (e.g., `"anthropic/claude-sonnet-4-5"`).
Expand All @@ -23,11 +21,9 @@ Use this tool to launch unrestricted child Pi sessions. The caller must include
```ts
spawn_subagent({
task: "Worker A full instructions...",
timeout: 900,
});
spawn_subagent({
task: "Worker B full instructions...",
timeout: 900,
});
```

Expand All @@ -40,10 +36,6 @@ Calls return immediately; the parent will be notified when each subagent complet
- No subagent types exist.
- No chain or parallel-list mode exists.
- `model` is an explicit override; omitting it inherits the active parent provider/model.
- `timeout` is optional and measured in seconds; omitted timeout defaults to 10 minutes.
- When `timeout` expires, the parent is informed that the subagent is still running; the child is not killed.
- Do not kill subagents autonomously to enforce `timeout`.
- Give explicit `timeout` values a healthy margin above expected runtime because child execution time can be wildly unpredictable.
- Tell the user/caller in second person that they **will be notified** when the subagent completes.
- Child Pi receives normal tools, skills, extensions, and project context.
- Child Pi gets only one automatic system line: `You are a Pi subagent controlled by another Pi agent.`
Expand All @@ -56,13 +48,8 @@ Calls return immediately; the parent will be notified when each subagent complet
When changing the pi-subagents extension contract, update every surface together:

1. Spawn tool schema in `extensions/pi-subagents/src/extension/schemas.ts`.
2. Spawn runtime defaults/validation and user-facing messages in `extensions/pi-subagents/src/extension/index.ts`.
2. Spawn runtime validation and user-facing messages in `extensions/pi-subagents/src/extension/index.ts`.
3. Skill docs in `extensions/pi-subagents/skills/pi-subagents/SKILL.md`.
4. GitHub issues/PR text exactly as requested by the user; do not fabricate details.

For timeout semantics specifically:

- Make schema and runtime agree that `timeout` is optional.
- Apply `timeout ?? 600` before constructing persisted records or timers.
- Phrase launch responses in second person: “you will be notified…” when the subagent completes.
- Preserve existing timeout behavior: timeout only notifies/marks timeout; it must not kill the child process.
Phrase launch responses in second person: “you will be notified…” when the subagent completes.
Loading
Loading