Skip to content

Commit 9cc8fa2

Browse files
authored
feat(pi-subagent): defer omitted role tools to Pi defaults (#75)
1 parent ee50584 commit 9cc8fa2

6 files changed

Lines changed: 111 additions & 168 deletions

File tree

package-lock.json

Lines changed: 46 additions & 156 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/pi-subagent/CONTEXT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Run one bounded task in one isolated Pi child process using a configured role.
88

99
- **Main**: Pi session delegating work.
1010
- **Subagent**: isolated Pi child process handling one task.
11-
- **Role**: user-owned Markdown profile defining name, description, system instructions, exact tools, extensions, and Skill names.
11+
- **Role**: user-owned Markdown profile defining name, description, system instructions, optional exact tool allowlist, extensions, and Skill names.
1212
- **Model Class**: `fast`, `balanced`, or `frontier`, chosen by Main from task complexity.
1313
- **Route**: configured model and thinking-level pair selected from Model Class; omitted class uses `balanced`, then Main route fallback.
1414
- **Delegated Task**: one bounded work request sent from Main to one Role.
1515

1616
## Invariants
1717

1818
- One Delegated Task creates one ephemeral child process and no saved session.
19-
- Ambient child extensions and Skills stay disabled; Role explicitly selects resources.
19+
- Ambient child extensions and Skills stay disabled; Role explicitly selects extensions and Skills. Omitted Role tools use Pi's effective `defaultTools` for built-ins; an explicit list is strict.
2020
- Role Skill names resolve through Main's effective Pi Skill registry; unavailable names warn and skip without blocking delegation.
2121
- Main selects Role and Model Class per task; omitted class uses configured `balanced`, then Main route fallback.
2222
- Role config lives only in user `config/pi-subagent` directory; model routes live in user `config/pi-subagent.json`; repository roles do not execute.

packages/pi-subagent/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ Fields:
3636
| --- | --- | --- |
3737
| `name` | yes | Role selected by Main |
3838
| `description` | yes | Tells Main when to use role |
39-
| `tools` | yes | Exact built-in and extension tool allowlist; use `[]` for none |
39+
| `tools` | no | Omit for Pi effective `defaultTools`; a non-empty list is an exact built-in and extension tool allowlist; use `[]` for none |
4040
| `extensions` | no | Absolute/user-home paths or package sources passed to Pi `--extension` |
4141
| `skills` | no | Effective Pi Skill names loaded for role |
4242
| Markdown body | yes | Role system instructions |
4343

44+
Omitted `tools` uses Pi's effective `defaultTools` for built-ins. Tools registered by Role extensions stay active without listing their names. A non-empty `tools` list strictly allowlists both built-in and extension tools; `tools: []` sends `--no-tools`.
45+
4446
String lists may also use comma-separated text, matching Pi's example role files. Repository-relative extension paths are rejected: child working directory is delegated project, so relative paths could load untrusted project code. Use absolute paths, `~/...`, or explicit package sources such as `npm:...`.
4547

4648
Skill entries use Pi Skill names, normally Skill directory names, not filesystem paths. At delegation time, package resolves names from Main's effective Pi Skill registry and passes matching files to child. Missing or unavailable Skills produce warning and are skipped; they do not block delegation. This preserves Main's trust and Skill collision decisions.

0 commit comments

Comments
 (0)