-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
macOS: Gateway daemon PATH excludes user bin dirs (nix, bun, local, etc.) #97992
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Summary
On macOS, the Gateway daemon service PATH excludes user bin directories — including
~/.nix-profile/bin,~/.bun/bin,~/.local/bin, and other common user-level binary paths. This means tools installed via Nix (and other user-level package managers) are unavailable to exec commands run by the Gateway.Root cause
OpenClaw already has code to detect Nix profile paths (
addNixProfileBinDirsinruntime-paths) and other user bin dirs (resolveDarwinUserBinDirs). However,getMinimalServicePathPartsdisables user dirs on macOS by default:This means
resolveDarwinUserBinDirs(which callsaddNixProfileBinDirs,addCommonUserBinDirs, etc.) is never invoked on macOS.Additionally,
mergeServicePathdoes not preserve existing PATH entries on macOS:So even if the operator manually edits
~/.openclaw/service-env/ai.openclaw.gateway.envto add extra PATH dirs, those changes are lost on the nextopenclaw gateway install.Expected behavior
User bin directories (especially
~/.nix-profile/bin) should be included in the daemon PATH on macOS, just as they are on Linux. The detection code already exists — it's just gated behindincludeUserDirs = falsefor darwin.Suggested fix
One or both of:
includeUserDirs = truefor darwin ingetMinimalServicePathParts, matching Linux behavior.env.servicePath.includeUserDirs: trueorenv.servicePath.extraDirs: ["/Users/me/.nix-profile/bin"]) so operators can opt in without code changes.Workaround
Manually edit
~/.openclaw/service-env/ai.openclaw.gateway.envto prepend the nix profile bin dir to PATH. This must be re-applied after everyopenclaw gateway install.Environment
~/.nix-profile/binpopulated