Skip to content

fix(runtime): forward XDG_* into detached Pi workers - #229

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/pi-worker-forward-xdg-a865
Nov 20, 2026
Merged

cursor[bot] merged 2 commits into
mainfrom
cursor/pi-worker-forward-xdg-a865

Conversation

@nettee

@nettee nettee commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Detached Pi worker spawn previously passed only PATH/HOME/USER/TMPDIR/LANG, dropping XDG_CONFIG_HOME.
  • buildPiEnvironment already allowlists XDG_*, but only copies them from the worker process.env, so Runs never saw wrangler OAuth under ~/.config/.wrangler (Leaf publish → not authenticated / demands CLOUDFLARE_API_TOKEN).
  • Forward the same peer keys that Pi inheritance already allowlists (XDG_CONFIG_HOME, XDG_CACHE_HOME, GH_CONFIG_DIR, etc.).

Context (carol / BCN-108)

Host mitigation: /Users/beacon/.local/bin/npx wrapper pins XDG_CONFIG_HOME (tea-style), because Leaf invokes npx wrangler@…. This PR is the durable upstream fix for the next Beacon install/upgrade.

Test plan

  • Unit/typecheck as usual in CI
  • On carol after pack/install: Run-like stripped env + serve XDG → npx wrangler@4.131.2 whoami authenticated; amr-release Leaf publish no longer submits high CF-cred feedback

liuyi and others added 2 commits November 20, 2026 10:36
Pi worker spawn used a minimal env that dropped XDG_CONFIG_HOME, so
wrangler OAuth under ~/.config was invisible inside Runs even when the
beacon serve wrapper had set it (Leaf publish / whoami not authenticated).
@cursor
cursor Bot merged commit 0e97362 into main Nov 20, 2026
3 checks passed
@cursor
cursor Bot deleted the cursor/pi-worker-forward-xdg-a865 branch November 20, 2026 02:39
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.

1 participant