Repository navigation
fix(agents): recognize Pi bundled npm entrypoint - #25040
boris-papevis wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Recognize Pi's bundled npm entrypoint —
src/shared/agent-node-entrypoint-identities.ts:20adds an optional(?:bundle\/)?segment to the Pi regex, so both…/@earendil-works|mariozechner/pi-coding-agent/dist/cli.jsand…/dist/bundle/cli.jsresolve topi. - Shared-recognizer coverage —
src/shared/agent-process-recognition.test.tsexercises both layouts across both scopes and POSIX / Windows-unquoted / Windows-quoted command forms, and adds a negative list pinning that the optional segment does not over-match. - Windows foreground coverage —
src/main/providers/agent-foreground-process-pi.test.tsparameterizes the ConPTY entrypoint and collapsed-OMP anchor cases over both entrypoints.
I verified the underlying claim against the npm registry: @earendil-works/pi-coding-agent moved its bin.pi from dist/cli.js (v0.84.2) to dist/bundle/cli.js (v0.99.0+), so this accepts a real layout and not a hypothetical one. comparablePath() lowercases and normalizes \ to / before matching, so the backslash Windows paths resolve against the forward-slash regex. The change is a single data edit in the shared identity list; every recognizeAgentProcessFromCommandLine consumer inherits it, and no other matcher or code path in the repo hardcodes the legacy Pi entrypoint. Locally, the 50 focused tests pass and oxlint is clean on all three files.
The PR body's caveat — that the matcher fix alone may not restore notes delivery if a separate Windows process-inspection issue exists — is a real open question but is explicitly out of scope for this change.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
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; 9 remain after this review. 📝 WalkthroughWalkthroughThe Pi identity pattern now accepts both Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No actionable issue remains in the reviewed change; it is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change recognizes one additional Pi installation layout while preserving the package-name and filename restrictions. No control bypass was established, but the complete notes-delivery authorization path was not verified. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
Carry the focused patch from boris-papevis/orca PR #25040 onto current main, with independent npm runtime and regression verification.
|
The complete patch is now merged in #25290, preserving Borys Papevis’s commit authorship. The successor was verified with real bundled and legacy npm installs, Windows process ownership, passing CI and completed automated reviews. Closing this PR as superseded. |

ELI5
Pi can launch from
dist/bundle/cli.js, but Orca only recognizes its olderdist/cli.jspath. Accept both so Orca can identify the bundled installation too.What Changed
Allow optional
bundle/in the shared Pi entrypoint matcher. Keep both supported npm namespaces and the existing package and filename checks.Extend the tests for both layouts, Windows and POSIX paths, unrelated-script arguments, and Pi/OMP foreground identity.
Why
I found the mismatch while investigating “Send notes” rejecting a running Pi terminal. Fixing the shared matcher covers its existing consumers without bypassing the notes-send checks.
Linked Issue
Fixes #25039
Visual Proof
N/A: no layout or rendering changes. I have not tested notes delivery with a patched Orca build.
Testing
git diff --checkpassed.I ran these on Windows with Node 24.21.0 and the repository's Vitest configuration. The Windows foreground tests use mocked process rows and console membership. The current-base Node typecheck rerun timed out; a local native-dependency rebuild also failed. I have not run a packaged build, native ConPTY/SSH acceptance, or end-to-end notes delivery.
AI Disclosure
I used GPT-6.1 Sol to help prepare the patch and tests.
Review
The only production change is the optional path segment. Note formatting, permissions, terminal binding, and delivery are unchanged. This patch does not address Pi headless-mode filtering or separate Windows process-inspection failures.
Agent skill upstream boundary
Notes
Keep support for the old layout and normalized Windows/POSIX paths. Existing local and remote terminal hosts need updated code to use the matcher.
Checklist