Repository navigation
Conversation
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
E2E tests did not runE2E tests run automatically for pull requests authored by users with write access or higher. For other contributors, someone with write access must add the Reason: See E2E testing guide for details. |
Code Review by Qodo
1.
|
PR Summary by QodoSelect exact vetted Pi extension tools for parent and child runs
AI Description
Merge Risk
|
ascerra
left a comment
There was a problem hiding this comment.
I'm for this. I hit the same limit with a small extension (code): once tools: names a built-in, Pi hides the extension tools, so I had to leave tools: off entirely (note).
One thing that may help now: with tools: left off, extension tools already run on fullsend. I ran them in a GitLab pipeline on v0.55.0 (results). So the CVE extension may not need to wait for this to run, only to be locked down. I haven't tried that extension itself.
Two questions inline.
Resolve native extension tools without widening parent or child permissions. Preserve MCP registration and exposure semantics, fail closed before inference, and guard the selector on launch and dispatch. Add pinned-Pi acceptance tests and document migration from silently ignored tool names. BREAKING CHANGE: Unknown Pi tool names now require a vetted extension that registers the exact requested name. Remove stale names or load their extension. Explicit empty selections now exclude extension tools as well as built-ins. Signed-off-by: eshulman2 <ellashulman1@gmail.com>
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
Site previewPreview: https://3ff9fb72-site.fullsend-ai.workers.dev Commit: |
|
Code review by qodo was updated up to the latest commit cc928ba |
waynesun09
left a comment
There was a problem hiding this comment.
HIGH: Required test check fails: the real-Pi MCP launch test does not stage the new tool selector (internal/runtime/pi_frontmatter_mcp_test.go around line 56; the file is not in this diff, so this note is here instead of inline)
The required test check fails at head cc928ba (run 45142513710, job 137583718330). All three subtests of TestPiBootstrap_DirectMCPRealPi fail (pattern, bare-parent, bare-persona). The errors are Error: Unknown option: --fullsend-selected-tools and Failed to load extension "/sandbox/pi-config/fullsend-tools.js": Extension path does not exist.
Bootstrap now always writes toolSelector into the child manifest, and both buildPiRunCommand and childArgs add -e /sandbox/pi-config/fullsend-tools.js. This PR does not change pi_frontmatter_mcp_test.go or testdata/pi-direct-mcp.mjs, and neither mentions fullsend-tools.js or FULLSEND_PI_MANIFEST_SHA256. So the child cannot load the selector, and pi rejects the unregistered flag. The local go test ./internal/runtime run in the PR body skipped this test because FULLSEND_TEST_PI_BIN was unset. CI sets that variable.
Suggestion: In testPiDirectMCP and testdata/pi-direct-mcp.mjs, stage fullsend-tools.js the same way as the other runner-owned extensions, or rewrite the toolSelector path. Export FULLSEND_PI_MANIFEST and FULLSEND_PI_MANIFEST_SHA256 for the child. Rerun with FULLSEND_TEST_PI_BIN set to pinned pi 1.6.0, and correct the Validation section of the PR body.
Verified: required check fails: test (TestPiBootstrap_DirectMCPRealPi, log grep); test files unchanged in diff at cc928ba; raised by: Claude
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
jflowers
left a comment
There was a problem hiding this comment.
Council review: REQUEST CHANGES
7 reviewers ran (adversary, architect, curator, fullsend, gaze-testing, guard, testing); 13 findings total: 1 HIGH, 7 MEDIUM, 5 LOW. Dispatch artifact: correlation b9e0db4f-4b28-4c7e-9980-0311aa32556c (.uf/artifacts/dispatch/).
Summary
The exact-selection design is sound, and the head commit visibly addresses earlier review feedback (selector exit 99 distinct from gateway 92, the same-process digest requirement, direct-MCP test staging, manifest field docs). CI is green. From what I can tell, one gap remains before this lands: the acceptance-critical real-Pi tests are env-gated, so the boundary's defining behaviors have no CI-enforced regression coverage. The MEDIUM items are test-quality hardening; the LOW items are optional.
Findings not anchored to this diff
- MEDIUM (guard): The breaking change lacks a CHANGELOG entry. Bootstrap now fails on previously-ignored tool names, and empty selections exclude extension tools; docs/runtimes/pi.md, docs/cli/run.md, and runtime-implementation.md describe the migration, but CHANGELOG.md carries no entry linking #9254 with BREAKING CHANGE treatment, which the issue explicitly requires. Could a changelog entry land in this PR?
Inline comments carry the remaining findings (1 HIGH, 5 MEDIUM, 5 LOW).
This review was generated by /uf.review-pr (AI-assisted).
| @@ -321,3 +324,26 @@ func piToolsFor(claudeTools []string) (tools, unsupported []string) { | |||
| } | |||
| return tools, unsupported | |||
| } | |||
There was a problem hiding this comment.
LOW (architect): The native versus MCP classification now lives in two places: this regex plus piMCPResourcePattern in Go, and mcpSelector in fullsend-tools.js (startsWith('mcp__') or /^(list|read)_mcp_/). The JS predicate accepts any list_mcp_* and mcp__ with an empty suffix; Go checks the closed resource list. Bootstrap fails closed early, so the divergence is masked today. Would a shared fixture or cross-check keep the two selectors from drifting when the syntax evolves?
There was a problem hiding this comment.
b3834d667 adds Go-side rejection coverage for bare mcp__ and an unknown list_mcp_ name. The proposed shared Go/JS fixture is still open.
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
|
The top-level review finding about the direct MCP integration fixture was fixed in |
waynesun09
left a comment
There was a problem hiding this comment.
MEDIUM: Docs still describe the replaced child loadout-guard path and pending unregistered names (docs/runtimes/pi.md lines 448-454; outside this diff's hunks, so the note is here instead of inline)
pi.md:448-454 says a child-only loadout guard restores the inherited active subset and that inherited names not yet registered may remain pending. runtime-implementation.md (around lines 1115-1120 and the extensions manifest row) says the same, and says childArgs adds fullsend-agent.js in child-only mode.
At head, every Agent manifest has toolSelector set. So the --fullsend-child-active-tools branch (fullsend-agent.js:536-537) is unreachable, and children go through fullsend-tools.js. That selector exits 99 on any unregistered non-MCP name instead of leaving it pending. The docs also never mention exit 99 or the selector's failure message, though pi.md and runtime-implementation.md list the other guard exit codes (97/94/95/93).
Suggestion: Rewrite the child-mechanism paragraphs in pi.md and runtime-implementation.md to describe the selector path (-e fullsend-tools.js --fullsend-selected-tools) and its fail-on-unregistered behavior. Add exit 99 and its message to the guard list and the troubleshooting table.
Verified: read docs at head; grep finds no exit 99 in pi.md or runtime-implementation.md at b3834d6; raised by: DeepSeek
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
|
The latest review’s documentation finding is addressed in |
waynesun09
left a comment
There was a problem hiding this comment.
Four MEDIUM findings from a review-only pass at d0c473b, inline below.
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
waynesun09
left a comment
There was a problem hiding this comment.
MEDIUM: The canonical pi Run command line and guard list in runtime-implementation.md still describe the launch from before the selector (docs/contributing/runtime-implementation.md around lines 824 and 840; both are outside this diff's hunks, so this note is here instead of inline)
When m.Tools != nil, buildPiRunCommand now does three new things (pi_run.go:485-487, 643-645, 722-724, 727-729):
- It adds a
piToolSelectionGuardbefore.envis sourced. - After
.env, it runsunset -f test [ command sha256sum cutand adds a second guard. - It appends
-e /sandbox/pi-config/fullsend-tools.jsafter the declared extensions. For an empty selection it emits--tools ''instead of--no-builtin-tools.
Two places in the doc still show the old behaviour:
- The "Hardening levers in use" bullet at about line 824 lists the old
-eset. It has nofullsend-tools.jsand no exit-99 guard. - The edit-repair bullet at about line 840 still justifies the parent's edit gate with "under --no-builtin-tools with no --tools, pi does not filter extension tools". The parent no longer emits that flag.
The earlier docs review covered pi.md:448-454 and runtime-implementation.md:1115-1120, not these lines.
Suggestion:
- Add
[-e /sandbox/pi-config/fullsend-tools.js]to the canonical command at line 824. It is emitted whentools:is declared, after the declared extensions. - Add a bullet to the guard list for the selector's guards before and after
.env, and exit 99. Or link to the section at about line 1155. - Reword the edit-repair rationale at about line 840 to say that an explicit
--toolslist, including--tools '', already filters extension tools.
Verified: read code (pi_run.go diff, runtime-implementation.md:820-841, diff hunks) at c28e446; raised by: DeepSeek
ascerra
left a comment
There was a problem hiding this comment.
The docs now answer my two questions from the first round (here). An agent file that names an extension tool is Pi-only and other runtimes get a definition of their own (here), and the change for agents that list a Claude-only name is in the migration note (here). What's left from those is that an agent that depends on an extension still runs on a runtime that skips it. I don't think that belongs in this PR, so I filed it as #9964.
I'm still for this. I tried the head on a local build with main merged in. The agent I used declares only cve in tools:, and the CVE assessment extension it loads registers that tool and one more.
- The session record lists
cveas the only tool the model was given, and the run finished with 22 calls to it. - With the name changed to one that no extension registers, the run stopped before the model was called.
[fullsend-tools] missing or ambiguous tool: cve_missing
...
Error: running agent (iteration 1): pi strict tool selection failed or selector changed; refusing inference
I said in the first round that our own agents are fine. I checked that again. Every tool name the agents on main in fullsend-ai/agents declare is either in the Pi runtime's map of built-in tool names or Skill, which it handles without a tool (here, example).
The branch conflicts with main today. Main now passes hooksEnabled to piBinaryPin (here), and this branch adds the selection guard right under that line (here). For my build it was enough to keep main's call with the guard under it, in pi_run.go and in TestBuildPiRunCommand_Basic, which checks how the launch command starts.
Main has also moved the pinned Pi from 1.6.0 (here) to 1.7.0 (here). On the merged tree the extension tests and the real-Pi launch test pass for me against 1.7.0. My runs of the agent still used an image with 1.6.0, so I haven't seen a whole run on 1.7.0.
Verified: local build of c28e446 with main ad41a65 merged in (two conflict hunks resolved by hand), sandbox runs of that build on the Pi runtime, and the extension tests plus TestPiBootstrap_DirectMCPRealPi on that tree against Pi 1.7.0; raised by: Claude
Summary
An agent can load a vetted Pi extension but lose its native tool names during translation. This implements exact native selection so
tools: [inspect_record]exposes that tool while excluding sibling tools and built-in shell/edit tools. Missing, hidden, ambiguous or non-vetted native selections fail before inference. Explicit empty selections exclude extension tools too.This replaces the ADR-only proposal with runtime code, tests and migration documentation. Adapted from the existing fork implementation, limited to Pi tool selection; journal and tracker changes are excluded. The original ADR additions and their links are removed from the final PR diff.
Closes #9254.
Implementation
The implementation is forge-neutral and applies on GitHub, GitLab and Forgejo.
Breaking change and migration
BREAKING CHANGE: previously ignored unknown Pi tool names now request exact native extension tools, and invalid native patterns fail setup. Remove stale Claude-only names or declare a vetted extension that supplies each exact requested name. An explicit empty selection now excludes extension tools as well as built-ins. The existing runner behavior of adding
readfor skills remains documented.Validation
FULLSEND_TEST_PI_BINset to pinned Pi 1.6.0, including all three direct MCP parent and child integration cases and the missing-digest regression for default-mode Agent parents. Package statement coverage is 94.5%.node --test --test-concurrency=1 internal/runtime/pi_extension/*.test.mjs. The default Node suite also checks that a missing tool fails at session startup before tools are activated.make lintandgit diff --checkpass.Prepared with coding-agent assistance. Human-directed commits carry DCO sign-off.