Repository navigation
fix(agents): recognize Pi bundled npm entrypoint (credited successor) - #25290
Conversation
Carry the focused patch from boris-papevis/orca PR #25040 onto current main, with independent npm runtime and regression verification.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe Pi entrypoint pattern now matches Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Pi processes using the bundled entrypoint can now be recognized alongside legacy installs. The supplied tests cover the supported command forms and foreground behavior, and no material merge risk is evident. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change narrowly expands Pi recognition while retaining package-path restrictions, terminal-ownership checks, and guarded notes delivery. No control bypass was identified. Recovery and concurrent delivery for the newly recognized layout were not fully verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Recognize Pi's bundled npm entrypoint — the package-anchored
piNode-entrypoint pattern insrc/shared/agent-node-entrypoint-identities.ts:20gains one optional segment (dist/(?:bundle/)?cli.js), covering@earendil-works/[email protected]'sdist/bundle/cli.jswhile keeping the legacydist/cli.jsand both npm scopes working. - Recognition tests parameterized —
src/shared/agent-process-recognition.test.tsnow exercises both scopes and both entrypoints across POSIX, Windows, and quoted spaced-Windows paths, and adds a negative table (nonode_modules, wrong scope/package,notnode_modules, trailing.extra,bundle/nested/, and Pi path present only as a later argv/--require/--evalargument). - ConPTY foreground tests parameterized —
src/main/providers/agent-foreground-process-pi.test.tsruns its two Windows foreground cases forcli.jsandbundle\cli.js.
I confirmed the load-bearing path against the real registry: @earendil-works/[email protected] declares "bin": { "pi": "dist/bundle/cli.js" }. The negative cases are genuine guards rather than theatre — a looser matcher (dropping the $ anchor or allowing a nested segment) would fail them. I found no other hardcoded pi-coding-agent/dist/cli.js matcher in src/main or src/shared; consumers resolve through this shared recognizer, so the single-line regex is the whole change. Ran both affected suites: 63 tests pass.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
Orca can miss Pi when npm starts its newer bundled CLI. Accept the exact bundled package path so existing agent recognition and notes-target checks can identify it.
What Changed
Allow one optional
bundle/directory in the canonical Pi Node entrypoint matcher. Preserve both npm namespaces, the older entrypoint, interpreter parsing, package boundaries and filename anchoring. Extend Windows/POSIX path and Pi/OMP foreground tests; unrelated Node arguments stay unidentified.Why
The npm package
@earendil-works/[email protected]declaresdist/bundle/cli.js;@mariozechner/[email protected]still declaresdist/cli.js. Extending the existing exact matcher fixes its consumers without broad basename matching or bypassing notes delivery guards. This credited current-main successor carries Borys Papevis's complete focused patch from #25040 (head13a927ba49443025ba616e39054bbed02b9b1557); the original remains untouched.Linked Issue
Related to #25039 and #25040. No closure requested.
Visual Proof
N/A — no renderer, screen rule, or layout changes. Actual npm process startup identity was measured through macOS
psand the compiled production recognizer: bundled Pi was null before and Pi after, old Pi stayed recognized, and a real unrelated Node server carrying the bundled Pi path as an argument stayed null. Pi later sets its process title topion macOS, already recognized on main; this establishes macOS startup identity rather than persistent macOS failure. Native Windows evidence appears below.Testing
On macOS with
ORCA_BACKGROUND_LAUNCH=1: 141 tests passed across recognition, Windows foreground fixtures, remote evidence, command wrappers, terminal-send and notes-target suites. Restoring main's matcher produced exactly 3 regression failures; restoring the patch passed all 63 directly affected tests. Real npm-installed versions 1.0.2 and 0.73.1 ran in RPC mode with isolated config, no session/extensions/skills or model turn. Their actual startuppscommands were checked against before/after production recognizers, plus a live unrelated Node process negative control.pnpm tc:node, changed-code quality gate, focused format check, andgit diff --checkpassed. Independent full three-path review passed 161 selected tests on the prospective composition with explicit mainddefd523e052cc83897937569d322a727f55dd78, confirming the full credited feature scope without unrelated main reversions. Hosted CI on unchanged public head6325dd4c4794a69bf29cadc702bd1f075bf6678dreports 14 successful and 18 skipped contexts, with no failures or pending contexts at the coordinator's check; skips are not executed proof. No packaged Electron build, rendered notes delivery, physical Linux/WSL or SSH reconnect, paid model turn, or TUI readiness is claimed.Additional actual native Windows x64 (OS version 10.0.26200) proof used npm-installed versions 1.0.2 and 0.73.1, task-owned configuration and Orca's real native process-table reader. Both actual Node entrypoints answered RPC
get_stateand exited zero without model calls. Production recognition identified the bundled and legacy layouts. The old Pi regex, compared against the canonical parsed entrypoint, returned null for bundled Pi and still matched legacy Pi; this Windows comparator was not a complete mutated baseline recognizer. The macOS before/after proof above used the complete compiled recognizers.A real unrelated Node script-file process carrying the installed bundled Pi path only as a later argument stayed unidentified. A separate real
node -enegative control also stayed null. Exact owned process cleanup was confirmed in fresh native process tables; no unrelated processes were targeted. Both packages declaremain: ./dist/index.js, which is irrelevant to thepibin/recognition rule: “old recognizer returned null” is not a null package-main claim.Windows verification on pinned
ddefmatched all three Git index blobs exactly to public head6325dd4c4794a69bf29cadc702bd1f075bf6678d. 139 Windows tests passed: 63 recognition/foreground tests and 76 process-table/native-addon/Windows-wrapper tests in disjoint files. Node typecheck and changed-file oxlint passed. These are separate from the macOS author 141 and independent 161 cohorts; counts are not added. The setup-added pnpm lockfile modification for observed pnpm 12.8.1 was preserved and excluded from feature scope.AI Disclosure
The original author disclosed GPT-6.1 Sol assistance; this successor was independently inspected and verified with Codex assistance.
Review
Independent review: CLEAR, whole-PR Low risk, accepted by ROOT on the pinned current-main composition. The public draft head remains unchanged; its public metadata base is
b32462f2465c58490af26f49a314d7602578ca8c, separate from that prospective proof. This records a recommendation, not an approval or merge action.Only production change: an optional path segment in a package-specific anchored regex. No credential/config directory changes, new subprocesses, status producers, wire fields, or notes-send bypasses.
Agent skill upstream boundary
Notes
Execution hosts need the updated matcher; an old remote host retains old recognition. No wire shape or identity vocabulary changes. Folder workspaces and git worktrees share this recognizer. Known separate product risk: current Pi recognition does not filter print/RPC modes; that already exists for older Pi entrypoints and is not repaired here. No TUI readiness or completed model-turn claim is made.
Checklist