fix: avoid systemd-supervised gateway retry loop in owned launcher#700
Merged
ashione merged 1 commit intoValueCell-ai:mainfrom Mar 28, 2026
Merged
fix: avoid systemd-supervised gateway retry loop in owned launcher#700ashione merged 1 commit intoValueCell-ai:mainfrom
ashione merged 1 commit intoValueCell-ai:mainfrom
Conversation
2 tasks
There was a problem hiding this comment.
Pull request overview
This PR prevents the ClawX-owned gateway child process from inheriting systemd “supervisor marker” environment variables, which can cause the openclaw gateway process to mis-detect itself as systemd-supervised and enter a retry loop.
Changes:
- Added
stripSystemdSupervisorEnvhelper to remove systemd marker env vars before spawning the gateway process. - Updated gateway launch env construction to apply the sanitizer.
- Added unit tests covering key removal, preservation of unrelated keys, and immutability.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
electron/gateway/config-sync.ts |
Introduces env sanitizer and applies it to the gateway fork environment. |
tests/unit/config-sync.test.ts |
Adds unit coverage for the new env-sanitizing helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
855cb4c to
c8b3ef0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
electron/gateway/config-sync.ts, strip systemd supervisor marker environment variables before spawning the gateway child process.openclaw gatewayfrom mis-detecting the owned ClawX child process as a supervised systemd instance and entering the 5s retry loop (already running under systemd).Risk / Tradeoff
Tests
pnpm exec tsc -p tsconfig.json --noEmitpnpm exec vitest run tests/unit/config-sync.test.tsNotes
stripSystemdSupervisorEnv.tests/unit/config-sync.test.tsto cover marker removal, unrelated-key preservation, and immutability.