Skip to content

fix(install): fail when OpenClaw is not on PATH - #134406

Merged
fuller-stack-dev merged 3 commits into
openclaw:mainfrom
ly85206559:codex/install-path-failure-exit
Sep 27, 2026
Merged

fuller-stack-dev merged 3 commits into
openclaw:mainfrom
ly85206559:codex/install-path-failure-exit

Conversation

@ly85206559

@ly85206559 ly85206559 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #133869

What Problem This Solves

Fixes the Windows installer reporting success after an upgrade when the installed openclaw command cannot be found on PATH.

User Impact

Windows users and automation receive a failed installation status instead of being told an unusable upgrade succeeded. The existing PATH recovery guidance remains visible.

Why This Change Was Made

Preserves Ben.Li’s original fix: record the missing-command failure through Fail-Install, leaving file-exit/scriptblock exception handling and successful service refresh followed by Doctor unchanged. The branch retains the original contributor commit and reconciles with the current installer.

Maintainer decision

Accepted: a Windows install or upgrade that leaves no discoverable openclaw command must fail, including for existing automation. This intentional exit-status change is the requested fix, not an unresolved compatibility choice. Preserve PATH recovery guidance and the canonical nonzero file-exit / terminating scriptblock-error behavior.

Evidence

  • The regression now runs the unchanged installer through native npm/git/OpenClaw command fixtures, covering missing and usable CLI upgrades in file and scriptblock modes, canonical failure/caller survival, and service/Doctor ordering.
  • Local source contracts: 18 passed (3.28 seconds wall across the selected tooling shard). All 55 PowerShell runtime cases skipped on macOS; those skips are not Windows evidence.
  • Exact-source independent review: no actionable P0–P2 findings. The full repository-selected affected check passed, including root-test typecheck, formatting and type-aware lint.
  • Native Windows proof executed the published 15b1b5bcf6d69940ac4c86f89c39f0f7042506d1 source on Windows 2025 with Node 24.20.0: 55 passed, zero skipped, including both Windows PowerShell and pwsh. The full-installer upgrade matrix took 16.634 seconds; the release-only file took 87.87 seconds (89.64 seconds dispatcher wall). The expensive real-process matrix is release-only, not added to per-PR CI.
  • The pre-fix negative control used identical tests/dependencies and only restored the original installer behavior: 54 passed and one intended failure. The real Windows PowerShell file upgrade reached installation and missing-PATH handling, then returned 0 instead of 1. Full file: 75.62 seconds; dispatcher: 77.37 seconds.
  • The native dispatcher does not independently attest all Windows descendant-process settlement. Completed GitHub-hosted ephemeral job teardown owns the retained temporary namespace; there is no persistent Testbox lease.
  • The earlier ClawSweeper review found no actionable correctness defect. Its requested compatibility decision is the explicit goal of this fix: an upgrade that leaves no discoverable command must fail, including for existing installer automation. Keep the guidance and canonical file/scriptblock failure semantics.
  • The previous required CI failure was fixed on main by 66b812f26e725cd709e08860d2cb46ba496cd308. The contributor-preserving refresh at 769f1e4bb3841b3317028202575ba3d349b0849b incorporates that repair without changing the two-file installer delta. Native Windows proof and the full-file/API review are reused for byte-identical source; fresh current-head CI and bot review remain required before landing.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Aug 31, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 6:50 PM ET / 22:50 UTC (Revision 6).

ClawSweeper review

What this changes

The Windows PowerShell installer now reports a failure when the installed openclaw command cannot be found, with native upgrade regression coverage for file and scriptblock invocation.

Merge readiness

✅ Ready for maintainer review

Current main and the latest release still report success when the Windows installer cannot find the installed command. This PR remains useful, and the recorded compatibility decision covers its intentional exit-status change. No actionable patch defect was found.

Priority: P1
Reviewed head: 769f1e4bb3841b3317028202575ba3d349b0849b

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A small production repair has focused native Windows before-and-after evidence and no actionable review finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The reviewed installer and test files match the proved source commit. The recorded native Windows replay exercised the unchanged installer through real PowerShell processes and command fixtures: missing-command upgrades failed in file mode and threw a catchable error in scriptblock mode, while usable-command upgrades continued through service refresh and Doctor. The pre-fix replay observed the incorrect zero result. GitHub confirms the replay job outcomes; its logs were inaccessible to this reviewer. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The reviewed installer and test files match the proved source commit. The recorded native Windows replay exercised the unchanged installer through real PowerShell processes and command fixtures: missing-command upgrades failed in file mode and threw a catchable error in scriptblock mode, while usable-command upgrades continued through service refresh and Doctor. The pre-fix replay observed the incorrect zero result. GitHub confirms the replay job outcomes; its logs were inaccessible to this reviewer. No stored-data contract changes.
Evidence reviewed 6 items Introduced installer behavior: The pinned PR delta adds Fail-Install after command discovery fails while retaining the existing PATH guidance.
Current main and release: Fetched main and the latest release both retain the warning-and-return path, so neither implements this failure result.
Existing result contract: Fail-Install records a nonzero result; Complete-Install exits for file invocation and throws for scriptblock invocation.
Findings None None.
Security None None.

How this fits together

The Windows installer installs or upgrades OpenClaw, checks whether its command is available, then refreshes an existing Gateway service and runs Doctor when needed. Its final result reaches the user or calling automation.

flowchart TD
  A[Windows install or upgrade] --> B[Install OpenClaw]
  B --> C[Check command on PATH]
  C -->|Missing| D[Show recovery guidance]
  D --> E[Report failure to caller]
  C -->|Available| F[Refresh service and run Doctor]
  F --> G[Report success]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +164, Other +1. Total +165 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 231 67 +164
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 1 +1
Total 2 233 68 +165

Review metrics

Metric Value Why it matters
Native Windows proof 55 passed, 0 skipped The recorded replay covers both Windows PowerShell and pwsh; the expensive process matrix remains release-only.

Root-cause cluster

Relationship: canonical
Canonical: #134406
Summary: The earlier merged installer audit identified the same missing-PATH result as follow-up work but did not fix it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the canonical failure result and PATH recovery guidance, then let the normal exact-head merge gates finish.

Do we have a high-confidence way to reproduce the issue?

Yes. Current-main source follows the warning-and-return path, and the recorded native Windows negative control observed status 0 where failure status 1 was expected; this review did not execute current main.

Is this the best way to solve the issue?

Yes. Using the installer’s existing failure handler changes the result without introducing another exit path or altering command discovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e9dc62b26f85.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster. Replaced prior rating: 🐚 platinum hermit.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P1: A Windows upgrade can currently report success while leaving users and automation without a discoverable OpenClaw command.
  • merge-risk: 🚨 compatibility: Existing installer automation will receive a nonzero result for a missing command; the PR body records acceptance of that specific tradeoff.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster. Replaced prior rating: 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The reviewed installer and test files match the proved source commit. The recorded native Windows replay exercised the unchanged installer through real PowerShell processes and command fixtures: missing-command upgrades failed in file mode and threw a catchable error in scriptblock mode, while usable-command upgrades continued through service refresh and Doctor. The pre-fix replay observed the incorrect zero result. GitHub confirms the replay job outcomes; its logs were inaccessible to this reviewer. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The reviewed installer and test files match the proved source commit. The recorded native Windows replay exercised the unchanged installer through real PowerShell processes and command fixtures: missing-command upgrades failed in file mode and threw a catchable error in scriptblock mode, while usable-command upgrades continued through service refresh and Doctor. The pre-fix replay observed the incorrect zero result. GitHub confirms the replay job outcomes; its logs were inaccessible to this reviewer. No stored-data contract changes.

Evidence

What I checked:

  • Introduced installer behavior: The pinned PR delta adds Fail-Install after command discovery fails while retaining the existing PATH guidance. (scripts/install.ps1:2411, 769f1e4bb384)
  • Current main and release: Fetched main and the latest release both retain the warning-and-return path, so neither implements this failure result. (scripts/install.ps1:2408, e9dc62b26f85)
  • Existing result contract: Fail-Install records a nonzero result; Complete-Install exits for file invocation and throws for scriptblock invocation. (scripts/install.ps1:124, 769f1e4bb384)
  • Native Windows proof: The PR body records 55 passing native Windows cases and a pre-fix negative control that returned 0 instead of 1. GitHub confirms the exact Windows replay step passed on the after-fix run and failed on the negative-control run. Workflow log downloads were blocked by the review environment, so the stated case counts could not be independently read from logs. The installer and test files are byte-identical between the proved source commit and the reviewed head. (test/scripts/install-ps1.release.test.ts:1912, 15b1b5bcf6d6)
  • Accepted compatibility tradeoff: The current PR body explicitly records acceptance of nonzero failure for existing automation when the command remains undiscoverable. A repository member refreshed the branch and requested re-review.
  • Related audit: The merged installer audit at fix(install): repair set-npm-prefix rc line and surface silent finalization failures #133869 identified this Windows PATH result as a follow-up; that PR fixed different installer defects. (a91edbcefaa2)

Likely related people:

  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ben.Li: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-31T19:11:39.440Z sha 7d8995d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-31T19:51:24.124Z sha 7d8995d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T19:58:54.051Z sha 7d8995d :: needs maintainer review before merge. :: none
  • reviewed 2026-09-26T05:53:08.309Z sha 15b1b5b :: blocked before merge. :: none
  • reviewed 2026-09-26T06:08:48.590Z sha 15b1b5b :: blocked before merge. :: none

@ly85206559

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Sep 15, 2026
@ly85206559

Copy link
Copy Markdown
Contributor Author

Status refresh (2026-09-16): current main still only warns and returns when OpenClaw is missing from PATH, so this fix has not been superseded. Exact head remains conflict-free, proof-sufficient, and required CI is green; no contributor-side code or review-thread action is outstanding.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Sep 17, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 19, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@fuller-stack-dev
fuller-stack-dev merged commit 10e9c41 into openclaw:main Sep 27, 2026
124 of 125 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants