#10182: fix: skip non-openclaw LaunchAgents in doctor gateway scan
gateway
stale
Cluster:
Cross-Platform Fixes
## Summary
- `openclaw doctor` falsely reported unrelated user LaunchAgents (e.g. `com.nexus.auto-commit`) as "Other gateway-like services detected"
- Root cause: `detectMarker()` scans the entire plist file content for the string "openclaw", which matches when an unrelated script simply references an openclaw binary path
- Fix: after the marker check, skip services whose label does not start with `ai.openclaw.` — only services in the openclaw namespace are considered candidates
- Legacy `clawdbot`/`moltbot` markers are unaffected since they use a different detection path
Closes #10158
## Test plan
- [x] Verified logic: only `ai.openclaw.*` labels pass through the new guard
- [x] Legacy labels (`clawdbot`, `moltbot`) still detected via `isLegacyLabel` path (line 171-183)
- [x] The actual gateway plist (`ai.openclaw.gateway`) is already skipped at line 128-130 via `isIgnoredLaunchdLabel`
🤖 Generated with [Claude Code](https://claude.ai/code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Updates the macOS LaunchAgents scan used by `openclaw doctor` to avoid false positives: after detecting an `openclaw` marker in a plist, it now ignores any service whose `Label` is not in the `ai.openclaw.*` namespace. This keeps unrelated LaunchAgents that merely reference an `openclaw` path/argument from being reported as “gateway-like” while preserving existing handling for legacy `clawdbot`/`moltbot` markers and the current gateway’s own ignored label.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is small, localized to the macOS LaunchAgents scan, and adds a narrow guard that only reduces false positives without affecting the legacy detection path; no new external I/O or behavioral coupling is introduced beyond filtering results.
- No files require special attention
<!-- 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
86.6%
#23666: fix(doctor): openclaw-browser.service falsely flagged as duplicate ...
by yinghaosang · 2026-02-22
82.5%
#11602: fix(config): skip stale legacy config files when openclaw.json exists
by akoscz · 2026-02-08
80.3%
#23584: fix(daemon): improve gateway service detection to avoid false posit...
by mohandshamada · 2026-02-22
79.8%
#8642: fix: improve launchctl bootstrap error messages for GUI domain issues
by dbottme · 2026-02-04
78.5%
#10744: fix: update stale MoltbotProtocol paths to OpenClawProtocol
by marezgui · 2026-02-06
78.4%
#20272: fix: LaunchAgent KeepAlive causes restart loop (fixes #20257)
by MisterGuy420 · 2026-02-18
77.6%
#16845: fix(daemon): gateway auto-restart on SIGTERM + agent restart guidel...
by kiminbean · 2026-02-15
77.3%
#21188: doctor: clean up legacy Linux gateway services
by Phineas1500 · 2026-02-19
76.6%
#5496: Fix: Windows path separators stripped in Gateway scheduled task
by giuliozelante · 2026-01-31
76.2%