← Back to PRs

#23666: fix(doctor): openclaw-browser.service falsely flagged as duplicate gateway (#23599)

by yinghaosang open 2026-02-22 15:23 View on GitHub →
gateway size: S trusted-contributor
## Summary - Problem: `openclaw doctor` flags `openclaw-browser.service` as a rogue "gateway-like service" and prints cleanup hints telling the user to disable `openclaw-gateway.service` — the actual primary gateway. - Why it matters: following the cleanup hints would kill the working gateway, causing a full outage. - What changed: `isIgnoredSystemdName()` in `src/daemon/inspect.ts` now also skips `openclaw-browser` (companion service) and `openclaw-node` (node host service). - What did NOT change: rogue/unknown openclaw services still get flagged. Legacy clawdbot/moltbot detection is untouched. ## Change Type (select all) - [x] Bug fix ## Scope (select all touched areas) - [x] Gateway / orchestration ## Linked Issue/PR - Closes #23599 lobster-biscuit ## Root Cause `isIgnoredSystemdName()` only matched the gateway service name (`openclaw-gateway`). The browser service file contains "openclaw" in its paths, so `detectMarker()` returns `"openclaw"`, but `isOpenClawGatewaySystemdService()` returns false because the name doesn't start with `openclaw-gateway`. So it lands in `extraServices` and triggers misleading cleanup hints. ## User-visible / Behavior Changes `openclaw doctor` no longer falsely flags `openclaw-browser.service` or `openclaw-node.service` as duplicate gateways. ## Security Impact (required) - New permissions/capabilities? No - Secrets/tokens handling changed? No - New/changed network calls? No - Command/tool execution surface changed? No - Data access scope changed? No ## Repro + Verification ### Environment - OS: Ubuntu 22.04 / systemd user services - Runtime/container: OpenClaw v2026.2.21-2 ### Steps 1. Install both `openclaw-gateway.service` and `openclaw-browser.service` 2. Run `openclaw doctor` ### Expected No false positive — browser service isn't a gateway. ### Actual Browser service flagged as "gateway-like", cleanup hints say to disable the real gateway. ## Evidence - [x] Failing test/log before + passing after 7 tests in `src/daemon/inspect.test.ts` — the browser false-positive test fails before the fix, passes after. All 135 daemon tests pass. ## Human Verification (required) - Verified scenarios: browser service ignored, node service ignored, rogue services still flagged, legacy services still detected, coexistence of browser + gateway produces zero results - Edge cases checked: non-.service files skipped, services without openclaw marker skipped - What I did **not** verify: live systemd environment (fix is in a pure string comparison, no I/O behavior change) ## Compatibility / Migration - Backward compatible? Yes - Config/env changes? No - Migration needed? No ## Failure Recovery (if this breaks) - Revert this single commit. The only change is adding names to an ignore list. - Known bad symptoms: if a rogue service is named exactly `openclaw-browser`, it would be missed. Extremely unlikely. ## Risks and Mitigations None — the change only adds entries to an ignore list. Can't break existing duplicate gateway detection. <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixes a false-positive in `openclaw doctor` where `openclaw-browser.service` and `openclaw-node.service` were incorrectly flagged as rogue "gateway-like" systemd services, causing misleading cleanup hints that could disable the actual working gateway. - `isIgnoredSystemdName()` in `src/daemon/inspect.ts` now skips `openclaw-browser` (via a new `KNOWN_COMPANION_SYSTEMD_NAMES` set) and `openclaw-node` (via the existing `resolveNodeSystemdServiceName()` resolver) - A new test file (`src/daemon/inspect.test.ts`) adds 7 test cases covering: browser/node false-positive prevention, rogue service detection, legacy service detection, non-service file skipping, and coexistence scenarios - Rogue/unknown openclaw services and legacy clawdbot/moltbot detection remain unaffected <h3>Confidence Score: 5/5</h3> - This PR is safe to merge — it only adds entries to an ignore list with no behavioral changes to I/O or service management. - The change is minimal and well-scoped: two new entries in an ignore list for known companion services. The fix is a pure string comparison with no I/O or side-effect changes. Test coverage is thorough with 7 test cases covering both positive and negative scenarios. The logic is straightforward and correct. - No files require special attention. <sub>Last reviewed commit: b7b2496</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs