Skip to content

fix(exec): prevent shell startup files from overriding daemon env#177

Open
BingqingLyu wants to merge 3 commits intomainfrom
fork-pr-40200-fix-issue-40179-exec-launchd-env
Open

fix(exec): prevent shell startup files from overriding daemon env#177
BingqingLyu wants to merge 3 commits intomainfrom
fork-pr-40200-fix-issue-40179-exec-launchd-env

Conversation

@BingqingLyu
Copy link
Copy Markdown
Owner

@BingqingLyu BingqingLyu commented Apr 27, 2026

Summary

  • run zsh exec commands with -f -c so .zshenv does not override inherited daemon environment variables
  • run bash exec commands with --noprofile --norc -c for the same deterministic env behavior
  • keep existing shell selection logic (including fish fallback), but derive args from shell type

Why

Issue openclaw#40179 reports exec commands seeing stale values despite launchd showing updated service env. Startup files can override inherited env values, causing this mismatch.

Testing

  • bash skills/openclaw-autonomous-contributor/scripts/quality_gate.sh /tmp/openclaw-issue-40179-1772997941

AI disclosure

This PR was prepared with AI assistance.

Fixes openclaw#40179

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: exec tool does not inherit gateway's environment variables (launchd)

2 participants