#23666: fix(doctor): openclaw-browser.service falsely flagged as duplicate gateway (#23599)
gateway
size: S
trusted-contributor
Cluster:
Cross-Platform Fixes
## 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
#15903: fix(doctor): stricter gateway service detection to prevent false po...
by Shuai-DaiDai · 2026-02-14
85.2%
#10182: fix: skip non-openclaw LaunchAgents in doctor gateway scan
by Yida-Dev · 2026-02-06
82.5%
#11602: fix(config): skip stale legacy config files when openclaw.json exists
by akoscz · 2026-02-08
81.9%
#23584: fix(daemon): improve gateway service detection to avoid false posit...
by mohandshamada · 2026-02-22
80.6%
#21188: doctor: clean up legacy Linux gateway services
by Phineas1500 · 2026-02-19
78.9%
#18498: daemon: load systemd EnvironmentFile and drop-ins so gateway status...
by saurav470 · 2026-02-16
77.8%
#16016: fix: update systemd unit version on gateway restart
by jbold · 2026-02-14
77.6%
#22327: fix(doctor): use gateway health status for memory search key check
by therk · 2026-02-21
77.4%
#11455: fix(gateway): default gateway.mode to local when unset
by AnonO6 · 2026-02-07
77.3%
#19885: test(gateway,browser): isolate tests from ambient OPENCLAW_GATEWAY_...
by NewdlDewdl · 2026-02-18
76.9%