openclaw - ✅(Solved) Fix [Bug]: Doctor’s “minimal PATH” function is contradictory and breaks hardened local [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71578Fetched 2026-04-26 05:11:13
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1labeled ×1

Doctor’s “minimal PATH” function is contradictory and breaks hardened local:

It calls many user/version-manager dirs “required.” Then warns when version/package-manager dirs are present. So with our hardened PATH, doctor complains they’re missing. If you add them back, doctor may complain PATH is non-minimal. So you cannot fully satisfy this doctor check locally without either:

  • accepting the harmless warning, or
  • changing OpenClaw’s doctor/service audit behavior.

Best durable fix: Patch OpenClaw so getMinimalServicePathParts() on Linux returns truly minimal stable dirs: /usr/local/bin /usr/bin /bin maybe /home/scotter/.local/share/pnpm And does not treat NVM/Volta/asdf/fnm/Bun dirs as required. Even better: doctor should distinguish:

  • “required runtime PATH”
  • “convenience user PATH”
  • “version-manager PATH risk”

Current code involved:

  • dist/runtime-paths-BOtHrzgd.js
  • dist/service-audit-BuAriCxq.js

But patching dist/ directly is fragile. Updates overwrite it.

Root Cause

Doctor’s “minimal PATH” function is contradictory and breaks hardened local:

It calls many user/version-manager dirs “required.” Then warns when version/package-manager dirs are present. So with our hardened PATH, doctor complains they’re missing. If you add them back, doctor may complain PATH is non-minimal. So you cannot fully satisfy this doctor check locally without either:

  • accepting the harmless warning, or
  • changing OpenClaw’s doctor/service audit behavior.

Best durable fix: Patch OpenClaw so getMinimalServicePathParts() on Linux returns truly minimal stable dirs: /usr/local/bin /usr/bin /bin maybe /home/scotter/.local/share/pnpm And does not treat NVM/Volta/asdf/fnm/Bun dirs as required. Even better: doctor should distinguish:

  • “required runtime PATH”
  • “convenience user PATH”
  • “version-manager PATH risk”

Current code involved:

  • dist/runtime-paths-BOtHrzgd.js
  • dist/service-audit-BuAriCxq.js

But patching dist/ directly is fragile. Updates overwrite it.

Fix Action

Fix / Workaround

Best durable fix: Patch OpenClaw so getMinimalServicePathParts() on Linux returns truly minimal stable dirs: /usr/local/bin /usr/bin /bin maybe /home/scotter/.local/share/pnpm And does not treat NVM/Volta/asdf/fnm/Bun dirs as required. Even better: doctor should distinguish:

  • “required runtime PATH”
  • “convenience user PATH”
  • “version-manager PATH risk”

But patching dist/ directly is fragile. Updates overwrite it.

PR fix notes

PR #71619: fix(daemon): keep Linux minimal service PATH truly minimal

Description (problem / solution / changelog)

Summary

  • stop treating Linux version-manager directories as part of the daemon's minimal service PATH
  • keep stable user bin directories like ~/.local/bin, ~/.npm-global/bin, ~/bin, Nix profiles, and pnpm
  • update Linux PATH tests to lock in the hardened-PATH behavior from #71578

Testing

  • pnpm test -- --run src/daemon/service-env.test.ts src/daemon/service-audit.test.ts

Closes #71578

Changed files

  • src/daemon/service-env.test.ts (modified, +38/-16)
  • src/daemon/service-env.ts (modified, +26/-19)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Doctor’s “minimal PATH” function is contradictory and breaks hardened local:

It calls many user/version-manager dirs “required.” Then warns when version/package-manager dirs are present. So with our hardened PATH, doctor complains they’re missing. If you add them back, doctor may complain PATH is non-minimal. So you cannot fully satisfy this doctor check locally without either:

  • accepting the harmless warning, or
  • changing OpenClaw’s doctor/service audit behavior.

Best durable fix: Patch OpenClaw so getMinimalServicePathParts() on Linux returns truly minimal stable dirs: /usr/local/bin /usr/bin /bin maybe /home/scotter/.local/share/pnpm And does not treat NVM/Volta/asdf/fnm/Bun dirs as required. Even better: doctor should distinguish:

  • “required runtime PATH”
  • “convenience user PATH”
  • “version-manager PATH risk”

Current code involved:

  • dist/runtime-paths-BOtHrzgd.js
  • dist/service-audit-BuAriCxq.js

But patching dist/ directly is fragile. Updates overwrite it.

Steps to reproduce

See summary.

Expected behavior

See summary.

Actual behavior

See summary.

OpenClaw version

2026.4.23

Operating system

Linux Mint latest

Install method

No response

Model

GPT 5.4 high

Provider / routing chain

OpenRouter

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The most likely fix is to patch OpenClaw's getMinimalServicePathParts() function to return truly minimal stable directories and distinguish between required runtime PATH, convenience user PATH, and version-manager PATH risk.

Guidance

  • Review the current implementation of getMinimalServicePathParts() in dist/runtime-paths-BOtHrzgd.js to understand how it determines the minimal PATH.
  • Consider modifying the function to exclude version-manager directories (e.g., NVM, Volta, asdf, fnm, Bun) from the required PATH.
  • Introduce separate categories for "required runtime PATH", "convenience user PATH", and "version-manager PATH risk" to improve the doctor's audit behavior.
  • Instead of patching dist/ directly, explore ways to override or extend the getMinimalServicePathParts() function without modifying the distributed code.

Example

No code example is provided due to the lack of specific implementation details.

Notes

The proposed fix requires modifying OpenClaw's internal functionality, which may have unintended consequences. It is essential to thoroughly test the changes to ensure they do not introduce new issues.

Recommendation

Apply a workaround by accepting the harmless warning or modifying the local PATH to satisfy the doctor's check, as a permanent fix would require updating OpenClaw's codebase.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

See summary.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Doctor’s “minimal PATH” function is contradictory and breaks hardened local [1 pull requests, 1 participants]