openclaw - 💡(How to fix) Fix Gateway launchd PATH not captured from current login shell [2 comments, 2 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#59665Fetched 2026-04-08 02:41:54
View on GitHub
Comments
2
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×2

Fix Action

Workaround

Manually edit the plist file or use a script to replace PATH after installation.

RAW_BUFFERClick to expand / collapse

Bug Description

After reinstalling OpenClaw Gateway (openclaw gateway install), the PATH environment variable in the generated LaunchAgent plist does not match the current login shell PATH.

Steps to Reproduce

  1. Ensure login shell PATH is correct (e.g., includes ~/.bin)
  2. Run openclaw gateway uninstall
  3. Run openclaw gateway install
  4. Check ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Expected Behavior

Gateway plist PATH should match current login shell PATH (from /bin/zsh -l -c 'echo $PATH')

Actual Behavior

Gateway plist contains outdated PATH with:

  • ❌ Non-existent directories (e.g., /Users/mtdcy/bin)
  • ❌ Missing current PATH entries (e.g., ~/.bin, ~/.cargo/bin)

Environment

  • macOS: Darwin 25.3.0 (arm64)
  • OpenClaw: 2026.3.28
  • Shell: /bin/zsh (login shell)
  • Installation: npm global package

Investigation

The getShellPathFromLoginShell() function in model-auth-env-QeMWu7zp.js appears to capture PATH during installation, but the captured PATH does not reflect the current login shell environment.

Workaround

Manually edit the plist file or use a script to replace PATH after installation.

Suggested Fix

Ensure PATH capture uses the actual login shell environment at install time, not a cached or stale value.

extent analysis

TL;DR

Update the getShellPathFromLoginShell() function to capture the PATH from the current login shell environment at installation time.

Guidance

  • Verify the current login shell PATH by running /bin/zsh -l -c 'echo $PATH' to ensure it includes the expected directories (e.g., ~/.bin).
  • Check the model-auth-env-QeMWu7zp.js file to understand how the getShellPathFromLoginShell() function captures the PATH during installation.
  • Consider implementing a workaround by manually editing the ~/Library/LaunchAgents/ai.openclaw.gateway.plist file or creating a script to update the PATH after installation.
  • Investigate potential caching or stale value issues in the getShellPathFromLoginShell() function that may be causing the outdated PATH to be captured.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The provided information suggests that the issue is related to the getShellPathFromLoginShell() function not capturing the current login shell PATH correctly. However, without more details about the function's implementation, it is difficult to provide a precise fix.

Recommendation

Apply a workaround by manually editing the ~/Library/LaunchAgents/ai.openclaw.gateway.plist file or creating a script to update the PATH after installation, as the root cause of the issue is not fully understood and may require further investigation.

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