openclaw - 💡(How to fix) Fix doctor: Gateway PATH check reports false warnings for non-existent user directories [2 comments, 3 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#76017Fetched 2026-05-03 04:43:16
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
2
Author
Timeline (top)
commented ×2closed ×1unsubscribed ×1

Error Message

The check should only warn about directories that: It should NOT warn about hypothetical directories that the user never had and never configured.

Root Cause

In runtime-paths-Dfe89gRZ.js, addCommonUserBinDirs unconditionally expects these directories:

function addCommonUserBinDirs(dirs, home, existsSync) {
  dirs.push(`${home}/.local/bin`);
  dirs.push(`${home}/.npm-global/bin`);
  dirs.push(`${home}/bin`);
  // ...
}

And addNixProfileBinDirs adds ${home}/.nix-profile/bin when NIX_PROFILES is not set.

These are pushed as "expected" directories regardless of whether:

  1. The user's shell PATH includes them
  2. The directories actually exist
  3. The Gateway service PATH was configured with them

Code Example

Gateway service PATH missing required dirs:
/Users/xiphis/.npm-global/bin, /Users/xiphis/bin,
/Users/xiphis/.nix-profile/bin

---

function addCommonUserBinDirs(dirs, home, existsSync) {
  dirs.push(`${home}/.local/bin`);
  dirs.push(`${home}/.npm-global/bin`);
  dirs.push(`${home}/bin`);
  // ...
}

---

PATH=/Users/xiphis/.local/bin:/opt/homebrew/opt/node/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

---

function addCommonUserBinDirs(dirs, home, existsSync) {
  addExistingDir(dirs, `${home}/.local/bin`, existsSync);
  addExistingDir(dirs, `${home}/.npm-global/bin`, existsSync);
  addExistingDir(dirs, `${home}/bin`, existsSync);
  addExistingDir(dirs, `${home}/.volta/bin`, existsSync);
  addExistingDir(dirs, `${home}/.asdf/shims`, existsSync);
  addExistingDir(dirs, `${home}/.bun/bin`, existsSync);
}
RAW_BUFFERClick to expand / collapse

Problem

Running openclaw doctor shows this warning:

Gateway service PATH missing required dirs:
/Users/xiphis/.npm-global/bin, /Users/xiphis/bin,
/Users/xiphis/.nix-profile/bin

These directories do not exist on my system and never have. They are not in my shell PATH, not in the Gateway service PATH, and not needed for any functionality.

Root Cause

In runtime-paths-Dfe89gRZ.js, addCommonUserBinDirs unconditionally expects these directories:

function addCommonUserBinDirs(dirs, home, existsSync) {
  dirs.push(`${home}/.local/bin`);
  dirs.push(`${home}/.npm-global/bin`);
  dirs.push(`${home}/bin`);
  // ...
}

And addNixProfileBinDirs adds ${home}/.nix-profile/bin when NIX_PROFILES is not set.

These are pushed as "expected" directories regardless of whether:

  1. The user's shell PATH includes them
  2. The directories actually exist
  3. The Gateway service PATH was configured with them

Why This Is Wrong

  1. False positive by design: The check compares an idealized "minimal PATH" against the actual service PATH, but the minimal PATH includes directories that may never exist.

  2. Ignores reality: My Gateway service env file has a clean PATH:

    PATH=/Users/xiphis/.local/bin:/opt/homebrew/opt/node/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

    This is correct and functional. The "missing" directories are neither needed nor wanted.

  3. User hostility: Telling users their PATH is "missing required dirs" when those directories are neither required nor present in any configuration is confusing and frustrating.

Expected Behavior

The check should only warn about directories that:

  • Are actually in the service PATH but don't exist
  • OR are explicitly configured by the user

It should NOT warn about hypothetical directories that the user never had and never configured.

Suggested Fix

Change addCommonUserBinDirs to use addExistingDir for all entries:

function addCommonUserBinDirs(dirs, home, existsSync) {
  addExistingDir(dirs, `${home}/.local/bin`, existsSync);
  addExistingDir(dirs, `${home}/.npm-global/bin`, existsSync);
  addExistingDir(dirs, `${home}/bin`, existsSync);
  addExistingDir(dirs, `${home}/.volta/bin`, existsSync);
  addExistingDir(dirs, `${home}/.asdf/shims`, existsSync);
  addExistingDir(dirs, `${home}/.bun/bin`, existsSync);
}

And fix addNixProfileBinDirs to not add non-existent default paths.

Environment

  • OpenClaw: 2026.4.29
  • Platform: macOS (darwin)
  • Install: Homebrew

extent analysis

TL;DR

The warning about missing required directories can be fixed by modifying the addCommonUserBinDirs function to only add existing directories to the list of expected directories.

Guidance

  • Review the addCommonUserBinDirs function to ensure it uses addExistingDir for all entries, as suggested in the issue.
  • Verify that the addNixProfileBinDirs function is not adding non-existent default paths.
  • Check the Gateway service PATH configuration to ensure it only includes directories that exist and are required.
  • Test the openclaw doctor command after applying the suggested fix to confirm the warning is resolved.

Example

function addCommonUserBinDirs(dirs, home, existsSync) {
  addExistingDir(dirs, `${home}/.local/bin`, existsSync);
  addExistingDir(dirs, `${home}/.npm-global/bin`, existsSync);
  addExistingDir(dirs, `${home}/bin`, existsSync);
  // ...
}

Notes

The suggested fix assumes that the addExistingDir function is already implemented and working correctly. If this function is not available, it will need to be implemented or an alternative solution will be required.

Recommendation

Apply the workaround by modifying the addCommonUserBinDirs function as suggested, as this directly addresses the root cause of the issue and should resolve the warning.

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…

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 - 💡(How to fix) Fix doctor: Gateway PATH check reports false warnings for non-existent user directories [2 comments, 3 participants]