fix: avoid systemd-supervised gateway retry loop in owned launcher (#700)
This commit is contained in:
committed by
GitHub
Unverified
parent
9b56d80d22
commit
514a6c4112
22
electron/gateway/config-sync-env.ts
Normal file
22
electron/gateway/config-sync-env.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
export const SUPERVISED_SYSTEMD_ENV_KEYS = [
|
||||
'OPENCLAW_SYSTEMD_UNIT',
|
||||
'INVOCATION_ID',
|
||||
'SYSTEMD_EXEC_PID',
|
||||
'JOURNAL_STREAM',
|
||||
] as const;
|
||||
|
||||
export type GatewayEnv = Record<string, string | undefined>;
|
||||
|
||||
/**
|
||||
* OpenClaw CLI treats certain environment variables as systemd supervisor hints.
|
||||
* When present in ClawX-owned child-process launches, it can mistakenly enter
|
||||
* a supervised process retry loop. Strip those variables so startup follows
|
||||
* ClawX lifecycle.
|
||||
*/
|
||||
export function stripSystemdSupervisorEnv(env: GatewayEnv): GatewayEnv {
|
||||
const next = { ...env };
|
||||
for (const key of SUPERVISED_SYSTEMD_ENV_KEYS) {
|
||||
delete next[key];
|
||||
}
|
||||
return next;
|
||||
}
|
||||
Reference in New Issue
Block a user