go-solver-pi-agent-binary-missing
Diagnosis complete and verified. The deliverable is written to ~/solution.md (also /workspace/solution.md).
Root cause. The pi-agent solve bridge (~/.local/bin/pi-agent) doesn't invoke pi via PATH — it locates the binary itself in findPiBin(), checking an ELF table then the npm-layout compiled entry script /tmp/pi/packages/coding-agent/dist/cli.js. That file is a build artifact (src/cli.ts → dist/cli.js, per tsconfig.build.json: rootDir src, outDir dist) and is not part of tracked source. A partial snapshot that copied only source files leaves /tmp/pi root (package.json, packages/, .git) fully visible — so "tree looks present" — but the one file the bridge needs is gone. All candidates miss → findPiBin() returns null → the bridge prints "pi binary not found" and process.exit(2).
Fix. Rebuild from a clean clone (do not patch the partial snapshot):
rm -rf /tmp/pi
git clone https://github.com/earendil-works/pi.git /tmp/pi
cd /tmp/pi && npm ci && npm run build
test -x /tmp/pi/packages/coding-agent/dist/cli.js
node /tmp/pi/packages/coding-agent/dist/cli.js --version # -> 0.84.3
Health probe that would have caught it: -f -x on the specific entry path plus an execution smoke (node ... --version must return a semver), short-circuiting the bridge's wasted 25-min deadline with exit 2 before the run.
Verified:
- tsgo -p tsconfig.build.json compiles src/cli.ts → dist/cli.js, RC=0
- existing build runs: node dist/cli.js --version → 0.84.3
- replicating findPiBin() with the entry removed + root present returns null → exit 2 / "pi binary not found" (exactly the reported symptom)
- healthy probe passes on the fixed tree: PROBE-OK 0.84.3
# Evidence - Problem class: go-solver-pi-agent-binary-missing - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-08-27T00:51:45.567Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Diagnose and document: the pi-agent solve bridge exits 2 with the message about a missing pi binary after the pi source tree under /tmp is replaced by a partial snapshot (the compiled entry script is gone even though the tree root looks present). Produce the rebuild recipe (fresh clone of the pi monorepo, dependency install, build, verify the entry script path) and the health probe that would have caught the failure.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-solver-pi-agent-binary-missing", "provider": "openrouter", "solved_at": "2026-08-27T00:51:45.567Z", "version": ""}Diagnosis complete and verified. The deliverable is written to ~/solution.md (also /workspace/solution.md).
Root cause. The pi-agent solve bridge (~/.local/bin/pi-agent) doesn't invoke pi via PATH — it locates the binary itself in findPiBin(), checking an ELF table then the npm-layout compiled entry script /tmp/pi/packages/coding-agent/dist/cli.js. That file is a build artifact (src/cli.ts → dist/cli.js, per tsconfig.build.json: rootDir src, outDir dist) and is not part of tracked source. A partial snapshot that copied only source files leaves /tmp/pi root (package.json, packages/, .git) fully visible — so "tree looks present" — but the one file the bridge needs is gone. All candidates miss → findPiBin() returns null → the bridge prints "pi binary not found" and process.exit(2).
Fix. Rebuild from a clean clone (do not patch the partial snapshot):
rm -rf /tmp/pi
git clone https://github.com/earendil-works/pi.git /tmp/pi
cd /tmp/pi && npm ci && npm run build
test -x /tmp/pi/packages/coding-agent/dist/cli.js
node /tmp/pi/packages/coding-agent/dist/cli.js --version # -> 0.84.3
Health probe that would have caught it: -f -x on the specific entry path plus an execution smoke (node ... --version must return a semver), short-circuiting the bridge's wasted 25-min deadline with exit 2 before the run.
Verified:
- tsgo -p tsconfig.build.json compiles src/cli.ts → dist/cli.js, RC=0
- existing build runs: node dist/cli.js --version → 0.84.3
- replicating findPiBin() with the entry removed + root present returns null → exit 2 / "pi binary not found" (exactly the reported symptom)
- healthy probe passes on the fixed tree: PROBE-OK 0.84.3
# Evidence - Problem class: go-solver-pi-agent-binary-missing - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-08-27T00:51:45.567Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Diagnose and document: the pi-agent solve bridge exits 2 with the message about a missing pi binary after the pi source tree under /tmp is replaced by a partial snapshot (the compiled entry script is gone even though the tree root looks present). Produce the rebuild recipe (fresh clone of the pi monorepo, dependency install, build, verify the entry script path) and the health probe that would have caught the failure.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-solver-pi-agent-binary-missing", "provider": "openrouter", "solved_at": "2026-08-27T00:51:45.567Z", "version": ""}