Repository navigation
bug(agents): YAML tools frontmatter leaves Gentle subagents without filesystem tools #62
Description
Bug Description
gentle-pi currently ships package agent definitions with tools declared as YAML block lists, but pi-subagents@0.32.0 appears to parse agent tools as a comma-separated scalar string.
In a live Pi session this caused Gentle 4R agents such as review-reliability and review-risk to start with only:
functions.intercom, functions.contact_supervisor, multi_tool_use.parallel
They did not receive read, grep, glob, or bash, so they could not inspect files/diffs and reported that they were blocked. The builtin reviewer agent worked in the same session because its bundled frontmatter uses scalar comma-separated tools.
Steps to Reproduce
- Install/use
gentle-pi@0.11.1withpi-subagents@0.32.0. - Run a Gentle 4R/custom agent, for example
review-reliability, viasubagent. - Ask the child to report its available tools or inspect a repo diff.
- Compare with builtin
reviewerin the same session.
Observed canary from the same parent session:
review-reliability: available_tools: functions.intercom, functions.contact_supervisor, multi_tool_use.parallel
review-risk: available_tools: functions.intercom, functions.contact_supervisor, multi_tool_use.parallel
reviewer: available_tools: functions.read, functions.grep, functions.find, functions.ls, functions.bash, functions.edit, functions.write, functions.intercom, functions.contact_supervisor, multi_tool_use.parallel
Expected Behavior
Gentle package agents that declare:
tools:
- read
- grep
- glob
- bashshould receive those tools in the child Pi session.
Actual Behavior
The child session receives only intercom/supervisor tools. The declared filesystem/shell tools are not available, so read-only review agents cannot review.
Evidence
Current gentle-pi uses YAML block-list tools, for example:
assets/agents/review-reliability.mddeclares:
https://github.com/Gentleman-Programming/gentle-pi/blob/ed47b60da90c31cf9b6f3099a91d192bc014f296/assets/agents/review-reliability.md#L4-L8
gentle-pi tests explicitly require YAML lists and reject comma-separated tools:
- https://github.com/Gentleman-Programming/gentle-pi/blob/ed47b60da90c31cf9b6f3099a91d192bc014f296/tests/package-manifest.test.ts#L70-L85
- https://github.com/Gentleman-Programming/gentle-pi/blob/ed47b60da90c31cf9b6f3099a91d192bc014f296/tests/sdd-agent-tools.test.ts#L16-L28
But pi-subagents@0.32.0 frontmatter loading stores block values as strings and later splits frontmatter.tools only by comma:
parseFrontmatterstores block values as strings: https://github.com/nicobailon/pi-subagents/blob/05019cda3917159efa5aa2ecd9d50834732a2b14/src/agents/frontmatter.ts#L68-L75loadAgentsFromDirparses tools with.split(","): https://github.com/nicobailon/pi-subagents/blob/05019cda3917159efa5aa2ecd9d50834732a2b14/src/agents/agents.ts#L1083-L1086
pi-subagents docs also show comma-separated scalar tools:
- https://github.com/nicobailon/pi-subagents/blob/05019cda3917159efa5aa2ecd9d50834732a2b14/README.md#L609
- https://github.com/nicobailon/pi-subagents/blob/05019cda3917159efa5aa2ecd9d50834732a2b14/README.md#L660-L662
Expected Fix Direction
Either direction would work, but the ecosystem needs one consistent contract:
- Update
pi-subagentsto parse YAML block-listtoolsinto individual tool names; or - Update
gentle-pipackaged agents/tests to use comma-separated scalartoolsuntil YAML arrays are supported by the runtime.
Given the current pi-subagents docs and runtime behavior, the fastest compatibility fix in gentle-pi may be to emit comma-separated tools in packaged agent frontmatter.
Operating System
macOS
Agent / Client
Pi / el Gentleman with pi-subagents
Shell
bash
Relevant Versions
gentle-pi: 0.11.1
pi-subagents: 0.32.0
Pre-flight Checks
- I searched existing issues/PRs for duplicates (
tools frontmatter,subagent tools,only intercom,contact_supervisor,review-reliability). - I understand this issue needs maintainer review/approval before opening a PR.
Activity
danielgap commentedon Jul 6, 2026
Additional current-session evidence: this is still reproducible with the latest active Pi extension install, not only the older versions in the original report.
Environment checked from
/home/dseo/.pi/agent/npm:npm viewconfirmspi-subagents@0.33.1,gentle-pi@0.11.3, and@earendil-works/pi-coding-agent@0.80.3are latest at the time of testing.Observed behavior in
/home/dseo/clavahachas:review-reliability,review-readability, andreview-resiliencelaunched throughsubagent(...)repeatedly reported they only hadintercom/contact_supervisortools and could not read files or write their requested audit artifacts.scoutand builtinreviewerworked in the same parent session and successfully read the repo and wrote artifacts.subagent({ action: "get", agent: "review-reliability" })displays the intended tools asread,grep,glob,bash, so discovery sees the frontmatter but runtime provisioning still fails for the YAML-list form.Local root-cause confirmation:
~/.pi/agent/agents/review-*.md,sdd-*.md, andjd-*.mduse YAML-list syntax:pi-subagents@0.33.1still parsesfrontmatter.toolsvia.split(",")insrc/agents/agents.ts, whileparseFrontmatter()stores YAML block values as strings. That means a block-list value can become one malformed tool name containing newlines instead of individual tools.buildPiArgs()then forwards the malformed allowlist topi --tools, leaving only bridge tools visible in the child session.One extra compatibility note: several Gentle agents declare
glob, while Pi help currently documentsfindin examples (pi --tools read,grep,find,ls). Ifglobis no longer a builtin in this runtime, the compatibility fix should probably normalize these agent allowlists tofindas well.Workaround confirmed in practice: avoid the Gentle
review-*agents for now and use builtinscout/ builtinreviewer, whose frontmatter uses comma-separated scalar tools and receives filesystem tools correctly.fix(pi): align review and Judgment Day tool allowlists
barbatdev commentedon Aug 15, 2026
Approved. The report has two independent reproductions, and there is enough evidence to act.
There are two separate causes behind the same user-visible failure: YAML block-list parsing in
pi-subagents, and packaged agents declaring unavailableglob/webfetchtools. PR #289 addresses only the second one.Keep #62 open after #289 merges. The issue is resolved only when the YAML parsing path is fixed and covered by a named regression test.
danielgap commentedon Aug 25, 2026
Closing the loop on the approval condition ("resolved only when the YAML parsing path is fixed and covered by a named regression test") — taking this final slice now.
Parsing path status: fixed upstream. pi-subagents 0.35.0 (2026-07-17) added
parseFrontmatterList, accepting newline block lists fortoolswhile preserving comma syntax (upstream nicobailon/pi-subagents#507, thanks to @klopket). Verified today by running the 0.35.0/0.56.0 algorithm verbatim against all 22 packaged agents on currentmain: every agent parses to its declared tool allowlist (including the"*": falsedeny-all shape on review/jd agents and thefind-for-discovery fix from #289). The 0.34.0 comma-only split that produced single garbage tokens is gone.Proposed slice (the named regression test): a new
tests/agent-tool-parsing-contract.test.tsthat vendors the exact upstream parsing contract (parseFrontmatterList+splitToolList, pinned by comment to pi-subagents >= 0.35.0 / upstream #507) and asserts, for every packaged agent, that:readpresent on all 22 agents),"*": falsedeny-all marker does not swallow the tools that follow it,mcp:entries included.If pi-subagents ever regresses to comma-only, or gentle-pi ships a YAML shape the parser collapses, this suite fails. PR incoming; no code/runtime change.
MataM15 commentedon Oct 9, 2026
Checked this against current
main(dafdd2b28, gentle-pi 4.0.0) with a source read, not a live session.The parsing side looks fixed in the Gentle Agents runtime that replaced pi-subagents (#609):
lib/agents-config.ts(parseFrontmatter) collects YAML block-list entries into arrays, andparseToolskeeps them as individual names.lib/agents-runner.tsforwards them to the child as a comma-separated--toolsvalue.assets/agents/declarereadas a separate list entry.tests/agents-config.test.ts("parseFrontmatter reads scalars, inline lists, and block lists") andtests/agents-runner.test.ts(asserts--tools read,grep,subagent_parent_message).What is still missing is the approval condition from the triage: the named packaged-agent regression (
tests/agent-tool-parsing-contract.test.ts) is not onmain. #429 was closed without merging and #1144 is still open.So the remaining work seems to be landing #1144 (or deciding the existing tests above are enough), after which this can probably be closed.