fix(pi): activate grep/find/ls and ship rg + fd in the sandbox image - #6752
Conversation
PR Summary by QodoEnable pi search tools, bundle rg/fd, and upgrade pi to 0.84.4
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
|
🤖 Review · Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
fb8fa2c to
8a0018d
Compare
|
🤖 Review · Commit: |
8a0018d to
9475ef0
Compare
Site previewPreview: https://96c5340f-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 4:07 PM UTC · Completed 4:24 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.73 |
|
Risk Assessment: elevated (3/5) DetailsElevated risk preserved from prior assessment: Tier 1 signals are unchanged (two protected-path files under images/, medium blast radius, moderate test ratio), high git churn persists across Containerfile (28 commits/30d with fix/reverts) and pi runtime files (pi_run.go: 21 commits/30d, pi_bootstrap.go: 10 commits/30d), partially offset by well-scoped changes tracing to issue #6464 and a known MEMBER contributor. Previous runRisk Assessment: elevated (3/5) DetailsElevated risk preserved from prior assessment: Tier 1 signals are unchanged (two protected-path files under images/, medium blast radius, moderate test ratio), high git churn persists across Containerfile (28 commits/30d with 6 fix/reverts) and pi runtime files (pi_run.go: 21 commits/30d with 11 fix/reverts, pi_bootstrap.go: 10 commits/30d with 7 fix/reverts), partially offset by well-scoped changes tracing to issue #6464 and a known MEMBER contributor. Previous run (2)Risk Assessment: elevated (3/5) DetailsElevated risk preserved from prior assessment: Tier 1 signals are unchanged (two protected-path files under images/, medium blast radius, moderate test ratio), high git churn persists across Containerfile (26 commits/30d with 6 fix/reverts) and pi runtime files (21 commits/30d on pi_run.go with 11 fix/reverts), partially offset by well-scoped changes tracing to issue #6464 and a known MEMBER contributor. Previous run (3)Risk Assessment: elevated (3/5) DetailsElevated risk preserved from prior assessment: Tier 1 signals are unchanged (two protected-path files under images/, medium blast radius, moderate test ratio), high git churn persists across Containerfile (26 commits/30d with 7 fix/reverts) and pi runtime files (21 commits/30d on pi_run.go with 11 fix/reverts), partially offset by well-scoped changes tracing to issue #6464 and a known MEMBER contributor. Previous run (4)Risk Assessment: elevated (3/5) DetailsElevated risk driven by two protected-path files (images/ prefix), high git churn across Containerfile and pi runtime files (15-26 commits in 30 days with frequent fixes), and medium blast radius, partially offset by well-scoped changes tracing to issue #6464 and a known contributor. |
ReviewFindingsMedium
Previous runReviewFindingsMedium
Low
Next steps:
Previous run (2)ReviewFindingsMedium
Low
Next steps:
Previous run (3)ReviewFindingsMedium
Low
Previous run (4)ReviewFindingsMedium
Labels: PR modifies sandbox image (images/sandbox/Containerfile), pi runtime code (internal/runtime/), and documentation |
9475ef0 to
f888e33
Compare
|
🤖 Finished Review · ✅ Success · Started 4:28 PM UTC · Completed 4:47 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.39 |
f888e33 to
da6a8eb
Compare
rh-hemartin
left a comment
There was a problem hiding this comment.
Why do we set the tools without mentioning the new tools installed? It shouldn't be installing rg (and friends) or setting the list of tools on pi settings?
Split the single-line "Hardening levers in use" bullet in runtime-implementation.md into sub-bullets so it can be reviewed as a diff, and state next to the defaultTools setting that pi's grep and find tools shell out to rg and fd, which is why the sandbox image ships them (PI_OFFLINE=1 and the egress policy block pi's own download). No facts moved or removed. Review feedback on #6752. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
Two different layers, and the mapping between them is pi's, not ours.
Both parts are needed because they fail independently:
So: settings turn the tools on, the image supplies what pi's implementation of those tools runs. I've made that coupling explicit in |
|
🤖 Review · Commit: |
pi 0.84.x starts with only read, bash, edit and write active (core/sdk.ts defaultActiveToolNames); grep, find and ls are registered but inactive unless settings.json sets defaultTools or --tools is passed. The runtime seeded neither, so every agent without `tools:` frontmatter (code, fix, review, retro) never had the search tools. Even when active, grep and find shell out to rg and fd, which the sandbox image does not ship; PI_OFFLINE=1 makes pi skip its release download and the egress policy would block it anyway, so both tools fail with "<tool> is not available and could not be downloaded". Seed defaultTools with all seven built-ins and bake ripgrep 15.2.0 and fd 10.5.0 (static musl builds, per-arch SHA256 pinned like gitleaks) into images/sandbox/Containerfile. Also records why pi 0.84.4 (already on main via #6745) is the floor: 0.84.3 failed every google-vertex request under the sandbox proxy (earendil-works/pi#8610). Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
Split the single-line "Hardening levers in use" bullet in runtime-implementation.md into sub-bullets so it can be reviewed as a diff, and state next to the defaultTools setting that pi's grep and find tools shell out to rg and fd, which is why the sandbox image ships them (PI_OFFLINE=1 and the egress policy block pi's own download). No facts moved or removed. Review feedback on #6752. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
181fceb to
262ba04
Compare
|
🤖 Finished Review · ✅ Success · Started 6:58 PM UTC · Completed 7:18 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $6.28 |
TestPiDefaultTools_CoversToolMap only checked map → defaults. Add the reverse: each piDefaultTools entry has a claudeToolForPi key, so a tool added to the defaults without a mapping fails here instead of reaching hook scripts under its raw pi name. Review feedback on #6752. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 7:26 PM UTC · Completed 7:38 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.46 |
Addressed in 480f005 (reverse tool-map check); human-approved by rh-hemartin, all required checks green.
|
🤖 Finished Retro · ✅ Success · Started 8:26 PM UTC · Completed 8:46 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.52 |
Retro: PR #6752 — fix(pi): activate grep/find/ls and ship rg + fd in the sandbox imageVerdict: Workflow went well. The review agent surfaced a genuine, actionable finding that improved the codebase. No novel proposals — identified gaps are tracked by existing issues. Timeline
What went well
Evidence for existing issues
Review quality assessment
The human reviewer's conceptual question ("Why do we set the tools without mentioning the new tools installed?") surfaced a design-understanding gap that no automated reviewer caught. This type of architectural-level feedback — questioning whether the abstraction is clear to future readers — remains a human-review strength. Total review agent cost: ~$32 across 5 successful runs. Approximately $6.28 was avoidable (run 4 on a docs-only commit). The final run's low cost ($3.46) suggests re-review scoping is partially working for cost, even if it still produces duplicate inline comments. |
Summary
pi's built-in
grep,findandlstools have never worked on the fleet's pi runs. Two causes stack:read, bash, edit, writeactive (packages/coding-agent/src/core/sdk.tsdefaultActiveToolNames);grep,findandlsare registered but inactive unlesssettings.jsonsetsdefaultToolsor the run passes--tools.piSettingsJSON()seeded neither, andbuildPiRunCommandonly emits--toolsfor agents withtools:frontmatter — socode,fix,reviewandretronever had the search tools (the 2026-08-23 local review transcript wasbash×22 /read×13, nothing else).grepshells out torgandfindtofd(utils/tools-manager.ts). The sandbox image ships neither; the runtime exportsPI_OFFLINE=1, which makes pi skip its GitHub-release download ("ripgrep not found. Offline mode enabled, skipping download."), and the egress policy would block that download anyway. Both tools fail with<tool> is not available and could not be downloaded.Changes:
internal/runtime/pi_bootstrap.go:piSettingsJSON()seedsdefaultToolswith all seven built-ins (--tools, when Run emits it, still replaces this); test updated; comment inpi_agent.gocorrected.images/sandbox/Containerfile: bake ripgrep 15.2.0 and fd 10.5.0 — static musl tarballs, per-arch SHA256 pinned the way gitleaks is, build assertionrg --version && fd --version.images/sandbox/Containerfile: a comment recording why pi 0.84.4 (now onmainvia chore(deps): update dependency @earendil-works/pi-coding-agent to v0.84.4 #6745) is the floor — 0.84.3 fails everygoogle-vertex(Gemini) request withHttpsProxyAgent is not a constructorwheneverHTTPS_PROXYis set, which the OpenShell sandbox always does (Regression in v0.84.3: 'Error: HttpsProxyAgent is not a constructor' when calling google-vertex with proxy earendil-works/pi#8610, fixed in 0.84.4).Verified against pi 0.84.4 source
defaultToolsis the settings key (docs/settings.md;core/sdk.ts:256-263:options.tools ?? (options.noTools ? [] : (configuredDefaultToolNames ?? defaultActiveToolNames)),defaultActiveToolNames = ["read","bash","edit","write"]), read fromPI_CODING_AGENT_DIR/settings.jsonin print mode too.--tools(main.ts:533→options.tools) replaces the set;--no-builtin-toolsshort-circuits beforedefaultToolsis consulted — so agents withtools:frontmatter keep their strict allowlist (existingTestBuildPiRunCommand_*cover the emitted flags;TestPiRuntimeBootstrap_NoSecurityNoHooksnow asserts the no-tools:path).json-event.tswas diffed 0.84.3→0.84.4 (byte-identical) and the adapter's node tests passed; nothing in this PR changes the wire format.RIPGREP_VERSION/FD_VERSIONnow havecustomManagersentries (github-releases); the SHA256 ARGs stay manual (ripgrep publishes.sha256assets, fd publishes none) and the build fails on a mismatch until refreshed.Test plan
go test ./internal/runtime/...(the twoTestDummyRuntime_*failures are pre-existing whenever an OpenShell gateway is running)rg/fdhidden from PATH +PI_OFFLINE=1,grep/findreturn the "not available and could not be downloaded" errors; with the binaries present both succeed;defaultToolsmakes the model report all seven tools.podman buildof the sandbox image (arm64):rg 15.2.0,fd 10.5.0,pi 0.84.4present; SHA256 checks pass.--model anthropic-vertex/claude-haiku-4-5):grep→internal/runtime/pi_run.go:183: func buildPiRunCommand(...),find→internal/runtime/pi_run.go internal/runtime/pi_run_test.go, bothisError=false.fullsend run review --runtime pion afullsend-codeimage built from this branch against a real PR: schema-valid result,defaultToolspresent in the sandbox's/sandbox/pi-config/settings.json, hooks active; a Grok orchestrator on the same image used thegreptool 5× (opus prefersbash grep).google-vertex/gemini-3.7-flashunder the sandbox proxy →HttpsProxyAgent is not a constructor); 0.84.4 image builds and pi loads both vendored extensions.fullsend-sandbox/fullsend-codedigests in fullsend-ai/agents after the next image publish.Refs #6464 (pi tracker). Rebased on #6745 (pi 0.84.4).