← Back to PRs

#21188: doctor: clean up legacy Linux gateway services

by Phineas1500 open 2026-02-19 19:18 View on GitHub →
gateway commands size: S
## Summary - add legacy Linux gateway unit names (`clawdbot-gateway`, `moltbot-gateway`) to `LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES` - update doctor legacy-service cleanup to remove Linux user legacy services via `uninstallLegacySystemdUnits` - keep existing macOS legacy cleanup behavior unchanged - add regression tests for Linux cleanup path and legacy unit-name constants ## Testing - `env NODE_OPTIONS='' pnpm vitest run src/commands/doctor-gateway-services.test.ts src/daemon/constants.test.ts` ## AI Assistance - [x] AI-assisted - Testing level: lightly tested (targeted unit tests above) - Prompt/session logs: not attached - Confirmed behavior and code paths were reviewed before submission Closes #21063 <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds legacy Linux gateway unit names (`clawdbot-gateway`, `moltbot-gateway`) to the cleanup constants and implements proper Linux systemd service removal in the doctor command. The implementation correctly handles Linux user-scoped systemd services by calling `uninstallLegacySystemdUnits`, which disables and removes the unit files. The macOS cleanup behavior remains unchanged and continues to use the existing `cleanupLegacyLaunchdService` function. - Added `clawdbot-gateway` and `moltbot-gateway` to `LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES` constant - Updated `maybeScanExtraGatewayServices` to handle Linux legacy services via `uninstallLegacySystemdUnits` - Maintained backward compatibility with existing macOS cleanup path - Added comprehensive test coverage for Linux cleanup and constants validation <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The changes are well-scoped, logically sound, and properly tested. The implementation correctly extends existing cleanup infrastructure to handle Linux legacy services without breaking macOS behavior. Error handling is appropriate with try-catch blocks and proper fallback messaging. The test coverage validates the key behavior change. - No files require special attention <sub>Last reviewed commit: 8953376</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs