#15903: fix(doctor): stricter gateway service detection to prevent false positives
channel: discord
gateway
agents
stale
size: S
Cluster:
Cross-Platform Fixes
## Problem
`openclaw doctor` detects any launchd service referencing `.openclaw/` paths as a "gateway-like service", even for unrelated scripts (#15849).
Example: A git auto-commit script (`com.jeeves.git-autocommit`) running from `~/.openclaw/workspace/scripts/` triggers detection.
Impact: Doctor suggests removing the active gateway (`ai.openclaw.gateway.plist`) — killing the running gateway.
## Root Cause
`detectMarker()` finds "openclaw" in plist content → flags as extra service → reports to user
The service is NOT a gateway service (label doesn't start with `ai.openclaw.`, no gateway marker), but gets flagged anyway.
## Solution
Add strict check: Only report "openclaw"-marked services that are ACTUALLY gateway services:
```typescript
if (marker === "openclaw" && !isOpenClawGatewayLaunchdService(label, contents)) {
continue; // Skip non-gateway services
}
```
## Changes
- `src/daemon/inspect.ts`: Skip reporting non-gateway services with openclaw marker
Fixes #15849
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR bundles 5 separate bug fixes addressing different issues:
- **fix(doctor)**: Prevents false positives from non-gateway services referencing `.openclaw/` paths (#15849)
- **fix(discord)**: Adds early bot message filtering to prevent self-DoS from MESSAGE_CREATE events (#15874)
- **fix(venice)**: Disables streaming by default to prevent SDK crashes with usage-only chunks (#15819)
- **fix(hooks)**: Adds debug logging to `triggerInternalHook` for diagnosing hook issues (#15827)
- **fix(cron)**: Normalizes seconds to milliseconds in timestamps to fix unit confusion (#15729)
**Critical issue found**: The main fix in `src/daemon/inspect.ts` has contradictory logic that will skip ALL services with the `openclaw` marker (lines 191-197). The code skips non-gateway services (191-193) but then also skips gateway services (195-197), effectively filtering out everything. This appears to be an accidental regression where the new check was added without removing the old check that was meant to skip the current/active gateway only.
<h3>Confidence Score: 1/5</h3>
- This PR contains a critical logical error that will break the intended functionality
- The main fix in `src/daemon/inspect.ts` has contradictory logic that makes all `openclaw`-marked services invisible to doctor, which defeats the purpose of the fix. The other bundled fixes appear sound, but the primary fix needs correction before merge.
- Pay close attention to `src/daemon/inspect.ts` lines 191-197
<sub>Last reviewed commit: 0f108f8</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#10182: fix: skip non-openclaw LaunchAgents in doctor gateway scan
by Yida-Dev · 2026-02-06
86.6%
#23666: fix(doctor): openclaw-browser.service falsely flagged as duplicate ...
by yinghaosang · 2026-02-22
85.2%
#23584: fix(daemon): improve gateway service detection to avoid false posit...
by mohandshamada · 2026-02-22
83.8%
#22327: fix(doctor): use gateway health status for memory search key check
by therk · 2026-02-21
79.6%
#10578: feat(doctor): exit with code 1 when critical errors are detected
by 13rac1 · 2026-02-06
78.3%
#5496: Fix: Windows path separators stripped in Gateway scheduled task
by giuliozelante · 2026-01-31
77.9%
#9460: fix(gateway): clean up lock file on service stop
by zenchantlive · 2026-02-05
77.2%
#15345: fix(daemon): doctor --fix pollutes service PATH with dirs that don'...
by yinghaosang · 2026-02-13
77.1%
#21742: fix(doctor): warn on conflicting exec approval config surfaces
by habakan · 2026-02-20
77.1%
#21188: doctor: clean up legacy Linux gateway services
by Phineas1500 · 2026-02-19
76.9%