← Back to PRs

#9879: Improve gateway probe diagnostics for slow channels

by wrgrant open 2026-02-05 20:12 View on GitHub →
gateway commands stale
When a slow/buggy channel (e.g. iMessage) blocks the health check, the probe would fail with a generic timeout and no indication of which channel was responsible. This change surfaces which channel is causing the timeout so users can identify and disable it in config. **Changes:** - Track current channel being probed in health state - Add `health.probeStatus` RPC to report active probe channel - On probe timeout, include channel name in error message (e.g. `timeout (health check blocked by channel: imessage; try disabling it in config)`) - Skip generic timeout hint when error already names the channel Made with [Cursor](https://cursor.com) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR improves gateway probe diagnostics when health checks hang on slow/buggy channels by (1) tracking the currently-probed channel in health state, (2) exposing a new read-only RPC (`health.probeStatus`) to report that channel, and (3) enriching probe timeout errors (and CLI output) with the channel name when available. It also tweaks health handling to avoid blocking non-probe callers while a refresh is in progress. The changes touch both the CLI-side probing (`src/gateway/probe.ts`, `src/commands/gateway-status/helpers.ts`) and gateway server request handlers/context (`src/gateway/server-methods/*`, `src/gateway/server.impl.ts`, `src/gateway/server/health-state.ts`). <h3>Confidence Score: 3/5</h3> - This PR is directionally sound but has at least one correctness issue that will prevent the new diagnostics from working as intended. - The probe-status channel tracking appears to be set from the CLI-side health snapshot code rather than the gateway server’s health refresh path, so `health.probeStatus` may not reflect real server-side probe activity. Additionally, the new async timeout handler in the probe can keep running after the probe settles, risking duplicate resolution/work. - src/commands/health.ts, src/gateway/probe.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs