Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nettee/beacon",
"version": "0.8.18",
"version": "0.8.19",
"description": "A single-host bridge from messaging and schedules to isolated agent runs",
"license": "Apache-2.0",
"repository": {
Expand Down
34 changes: 27 additions & 7 deletions services/daemon/src/runtime/pi-worker-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,16 +397,36 @@ export async function spawnDetachedPiWorker(
);
}

// Forward XDG_* (and peer allowlisted keys) into detached Pi workers.
// buildPiEnvironment already inherits these from process.env for the Pi child,
// but only if the worker process itself still has them — the previous minimal
// env strip dropped XDG_CONFIG_HOME, so wrangler OAuth under ~/.config failed
// inside Runs while `beacon` serve (wrapper) still looked fine.
const workerEnv: NodeJS.ProcessEnv = {
PATH: process.env.PATH,
HOME: process.env.HOME,
USER: process.env.USER,
TMPDIR: process.env.TMPDIR,
LANG: process.env.LANG,
};
for (const key of [
"LOGNAME",
"SHELL",
"LC_ALL",
"TERM",
"COLORTERM",
"SSH_AUTH_SOCK",
"XDG_CONFIG_HOME",
"XDG_CACHE_HOME",
"GH_CONFIG_DIR",
] as const) {
const value = process.env[key];
if (value !== undefined) workerEnv[key] = value;
}
const child = spawn(process.execPath, [workerMainPath, lifecycleDirectory], {
detached: true,
stdio: "ignore",
env: {
PATH: process.env.PATH,
HOME: process.env.HOME,
USER: process.env.USER,
TMPDIR: process.env.TMPDIR,
LANG: process.env.LANG,
},
env: workerEnv,
});
if (child.pid === undefined) {
throw new Error("Failed to spawn detached Pi worker (no pid)");
Expand Down
Loading