v0.1.14 — Subagent tool restriction and write/edit permission fix
Fixed
-
Issue #4 — write/edit permission collision:
writeandeditare now separate permission categories. Previously,{edit: true, write: false}silently producededit: denydue to both mapping to the same key. In pi,write(create/overwrite) andedit(search-and-replace) are distinct tools. -
Issues #1 + #2 — Subagent tool restriction: OpenCode-style
tools:map and explicitpermission:blocks now restrict the subagent child process toolset via the--toolsCLI flag. Previously, these restrictions were silently ignored for subagents — the child received all tools regardless.
Changed
toolToPermission()andtoolsMapToPermission()no longer collapsewriteintoedit. Onlyapply_patch(OpenCode-only) still maps toedit.- New
deriveToolsWhitelist()in subagent executor derives--toolsfrom permission allow-lists when no explicit tools array exists. - Removed dead
PI_OPEN_AGENTS_PERMISSIONfromRecursionEnvtype.
Known limitations
- Wildcard permissions (
*: allow+ specific denies) cannot produce a finite--toolswhitelist — the CLI flag is a whitelist, not a deny-list. The child gets all tools in this case. - Issue #3 (
variant:field) not addressed — requires a pi-core--variantCLI flag.
Tests
- 97 tests (84 existing updated + 13 new), all passing