Repository navigation
Stop reporting remote connector websocket disconnects to Sentry - #916
Conversation
Disconnects (1005/1006 and similar) are expected lifecycle noise for home connectors. Keep the ops console.warn; reserve Sentry for auth and handler errors that already capture at error level.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughWebsocket disconnect and error handling now emits operational console warnings without reporting expected lifecycle events to Sentry. Tests were updated to verify Sentry capture remains suppressed, including deduplication behavior. ChangesWebsocket lifecycle reporting
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🔎 Preview deployed: https://kody-pr-916.kody-a99.workers.dev Worker: Mocks:
|
* Keep expected MCP caller errors out of Sentry Capability handlers throw plain Errors for caller mistakes (missing arguments, ids that do not resolve, preconditions the caller must clear) and every one of them opened a Sentry issue that reads like a platform bug. Five of the fourteen open kody-cloudflare issues are this class. Adds McpCallerError so a failure site can say the caller caused it, skips Sentry for parse_input failures (arguments never matched the declared schema), and adds a callerError payload flag for the search paths that report a caller mistake without throwing. Extends the same carve-out #916 and #917 made for connector disconnects and sandbox execute failures. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com> * Stop reporting OpenAPI missing path params to Sentry Caller mistakes like omitting organization_id_or_slug were thrown as plain Errors from buildOperationUrl and opened Sentry issues that look like platform bugs (KODY-CLOUDFLARE-1S). Throw McpCallerError instead so observability keeps them on mcp-event logs only. * Only skip Sentry for caller-attributed search batch failures Review feedback: a total entity-batch failure could hide platform incidents when every lookup failed for DB/load reasons. Preserve per-entry McpCallerError provenance and set callerError only when all failures are caller mistakes. Also mark search-detail not-found paths as McpCallerError. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…#932) * fix(sentry): stop reporting remote connector tools/list refresh noise tools/list timeouts and disconnects during snapshot refresh are expected home-connector lifecycle noise (same class as websocket closes in #916). Keep the soft-fail clear + ops console.warn; reserve Sentry for auth and handler bugs. Refs KODY-CLOUDFLARE-24. * fix(sentry): keep Sentry for unexpected tools/list refresh failures Address review: only suppress expected lifecycle noise (timeout, disconnect, not connected, connector RPC error). Malformed tools/list payloads and other implementation errors still rethrow into the message-handler Sentry path and do not clear a still-valid tool cache. * fix(sentry): validate tools/list result shape before cache replace Reject non-object results and non-array tools so malformed payloads keep the prior tool cache and surface through the message-handler Sentry path. * fix(sentry): harden tools/list soft-fail and result validation Reject array-valued tools/list results, and restore the in-memory tool cache if soft-fail persistence fails so storage bugs still reach Sentry without blanking later reads. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Summary
Sentry issue 7631428009 (
code=1006 wasClean=false) and sibling 7631278616 (code=1005 wasClean=true) are warning-levelcaptureMessagenoise fromRemoteConnectorSession.handleDisconnect.Remote connector websockets disconnect constantly for expected reasons (laptop sleep, process restart, flaky home networks, DO migration). Auth failures and message-handler bugs already report at error level. This PR keeps the ops
console.warnand stops opening Sentry issues for routine closes.Test plan
console.warnand do not callSentry.captureMessageSiblings
System recap — extends existing primitives (medium risk)
Mode: recap · Base:
main@49893e20· Head:4dd51ca9Classification: extends — remote connector session disconnects no longer open Sentry warnings; ops logging unchanged.
Primitives touched
connector-ingresscaptureMessageremote-connectorsSystem map
Remote connector websocket closes used to become Sentry warnings; they now stay on worker logs only.
Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context.
Before / after
Before: every
webSocketClose/webSocketErrorcalledSentry.captureMessageat warning, creating issues per close code/reason.After: disconnects log with
console.warn; Sentry remains for auth/handler errors already captured at error level.Risk and invariants
Docs
No doc updates; observability policy change covered by unit tests.
Summary by CodeRabbit