Skip to content

fix(cli): sanitize inherited Pi package directory - #120

Merged
rochecompaan merged 2 commits into
mainfrom
agent/issue-117-patchmill-inherits-outer-pi-pi-package-dir-and-b
Jul 28, 2026
Merged

fix(cli): sanitize inherited Pi package directory#120
rochecompaan merged 2 commits into
mainfrom
agent/issue-117-patchmill-inherits-outer-pi-pi-package-dir-and-b

Conversation

@rochecompaan

@rochecompaan rochecompaan commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Sanitized executable Patchmill invocations by deleting inherited PI_PACKAGE_DIR before loading the bundled CLI graph.
  • Added a fresh-process regression fixture that proves sanitization precedes CLI module evaluation, child processes inherit the sanitized environment, unrelated credentials/session metadata remain available, and exit-code propagation still works.

Validation

  • node --test bin/patchmill.test.ts passed (2/2)
  • npm test passed (1122 tests, 0 failures)
  • npm run lint passed
  • npm run build passed (emission check; TypeScript build has noCheck enabled)
  • node dist/bin/patchmill.js --help passed
  • PI_PACKAGE_DIR=/nix/store/outer-pi/libexec/pi "$package_path/bin/patchmill" --help passed after nix build .#patchmill --no-link --print-out-paths
  • git diff --check passed; worktree clean

Reviews

  • Final Codex full-worktree review: pass, no findings.
  • Final thermo-nuclear full-worktree review: pass, no findings.
  • Final validation-readiness review: pass, all required commands rerun.

Closes #117

Patchmill run cost

Stage Model Prompt tokens Output tokens Estimated cost (USD)
Development environment gpt-5.5 321,202 1,700 $0.5857
Implementation gpt-5.5 1,640,610 12,277 $1.6133
Implementation gpt-5.6-sol 1,198,844 17,221 $1.9858
Implementation gpt-5.6-terra 1,244,518 4,376 $0.5688
Implementation subtotal 4,083,972 33,874 $4.1679
Total 4,405,174 35,574 $4.7535

Prompt tokens include uncached input, cache reads, and cache writes. Cost is an estimate based on Pi's recorded model pricing and includes parent and subagent sessions.

@rochecompaan
rochecompaan merged commit 4319009 into main Jul 28, 2026
2 checks passed
@rochecompaan
rochecompaan deleted the agent/issue-117-patchmill-inherits-outer-pi-pi-package-dir-and-b branch July 28, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Patchmill inherits outer Pi PI_PACKAGE_DIR and breaks bundled Pi resources

1 participant