fix(gateway): keep watch restarts in-process

This commit is contained in:
Peter Steinberger
2026-04-05 13:15:18 +01:00
parent 2f5d6c859d
commit aca488d5be
3 changed files with 49 additions and 0 deletions

View File

@@ -44,6 +44,9 @@ export async function runWatchMain(params = {}) {
const watchSession = `${deps.now()}-${deps.process.pid}`;
childEnv.OPENCLAW_WATCH_MODE = "1";
childEnv.OPENCLAW_WATCH_SESSION = watchSession;
// The watcher owns process restarts; keep SIGUSR1/config reloads in-process
// so inherited launchd/systemd markers do not make the child exit and stall.
childEnv.OPENCLAW_NO_RESPAWN = "1";
if (deps.args.length > 0) {
childEnv.OPENCLAW_WATCH_COMMAND = deps.args.join(" ");
}