Repository navigation
fix(install): preserve empty PATH search entries - #147249
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 3:25 PM ET / 19:25 UTC (Revision 3). ClawSweeper reviewWhat this changesThe CLI installer preserves intentional current-directory entries and search order in PATH, returns not found when every directory is excluded, and adds regression coverage. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main retains both PATH defects, and the merged parent explicitly leaves them to this follow-up. No actionable findings remain; the earlier unmerged-parent blocker is resolved. Priority: P2 Review scores
Verification
How this fits togetherThe CLI installer searches PATH for Node, npm, and optional runtime tools, validates the selected runtime, and links it into the installation prefix. These selectors support FreeBSD and Alpine setup and optional-tool discovery. flowchart TD
A[User PATH] --> B[Preserve ordered entries]
B --> C[Exclude managed runtime directories]
C --> D[Find command or usable runtime]
D --> E[Validate Node and npm]
E --> F[Publish runtime links]
C --> G[Return not found when empty]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +68, Other +3. Total +71 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep runtime discovery within the existing selectors, preserving Bash PATH semantics while retaining candidate validation and managed-runtime exclusions. Do we have a high-confidence way to reproduce the issue? Yes: current-main source exposes both mechanisms—dropping a trailing empty component and searching the current directory after all entries are excluded—and the supplied historical regressions exercise them. This review did not execute the installer. Is this the best way to solve the issue? Yes: the delimiter and retained-entry guard repair the existing selectors directly, preserve their callers and validation, and avoid adding another runtime-selection implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cf45ff4d6a9c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
8fd304a to
f3d75ea
Compare
b6d3369 to
9170bc5
Compare
|
Merged via squash.
|
Related: #45233
Parent landed: #147221
What Problem This Solves
The CLI installer's PATH splitters discard a trailing or sole empty component, even though Bash treats that component as the current directory. A usable local runtime can disappear from lookup. Separately, filtering every search directory leaves an empty PATH, which accidentally searches the current directory again.
User Impact
Runtime discovery preserves PATH search order and intentional current-directory entries. Excluding every managed directory returns not found instead of introducing a new lookup location. Default FreeBSD alias reuse remains supported.
Why This Change Was Made
Append a delimiter before Bash splits PATH so the final original component survives. Reuse the selector's existing separator as the retained-entry indicator, distinguishing an intentional empty component from no retained entries.
Production is net +3 lines, including two comments. Ten focused cases add 68 test lines. This is the separately scoped PATH parsing repair identified while reviewing the runtime-link change.
Evidence
9170bc52e152d880914fef920575cb62f762c440, based on landed parent4d6ebf94. Independent review verified the sole repair commit is patch-identical and inherits the parent’s macOS fixture and tuple typing corrections.b6d3369c: the ten new cases produced the expected five failures against parent8fd304ae1042ee082e4c6f73e0318622cbba63fe. Restoring that reviewed head and runningnode scripts/run-vitest.mjs test/scripts/install-cli.test.ts test/scripts/install-cli.freebsd.test.tspassed 147 tests, with one Darwin-only skip. The original completed client receipt verifies the source SHA and clean tracked state before/after, exit 0, and the disposable box stopped. Backing run.b6d3369c. A restricted PATH with a trailing current-directory entry selected the system runtime; published node/npm still worked after changing directories. Actual fresh and repeat OpenClaw 2026.9.4 installations passed, including active-alias reuse and native Node 24.20.0 / SQLite 3.53.4 NUL round-trip verification. The complete terminal log and source digest were checked. This covers installer and CLI behavior; it makes no service or all-addon readiness claim.9170bc52:pnpm tsgo:test:rootpassed, then the canonical two-file installer command passed 147 tests, with one expected Darwin-only skip. The original complete client receipt verifies exact HEAD and clean tracked state before and after, command exit 0, and the disposable box stopped. This covers the inherited macOS fixture selection and tuple typing integration on the Linux host; historical native receipts retain the platform limits stated above. Backing run identifies the disposable session lifecycle, not a required-CI result.The parent has landed. This PR targets main with only the PATH parsing repair. Normal exact-head CI and native maintainer gates remain required before merge.