← Back to PRs

#15903: fix(doctor): stricter gateway service detection to prevent false positives

by Shuai-DaiDai open 2026-02-14 01:52 View on GitHub →
channel: discord gateway agents stale size: S
## 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