Add Discord adapter health check using client.ws.ping#87
Merged
Conversation
Implement health check functionality for Discord adapter to verify connection status using WebSocket ping. Changes: - Add optional healthCheck() method to ChannelAdapter interface - Implement healthCheck() in Discord adapter using client.ws.ping - Checks WebSocket status (READY = 0) - Validates ping latency (>= 0 and < 10s) - Returns false if not started or on errors - Update ChannelLifecycleManager to call adapter.healthCheck() if available - Add 8 comprehensive tests for all health check scenarios Task: @01KGGTRK Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Author
PR Review SummaryImplementation ReviewQuality: Excellent Changes:
Test CoverageAll health check scenarios covered:
Spec AlignmentNote: This task has no spec_ref, so this is an infrastructure improvement without formal acceptance criteria. Implementation follows best practices:
CI Status
Issues FoundNone - all quality gates pass. VerdictReady to merge. Implementation is clean, well-tested, and follows established patterns. The optional health check method enables platform-specific health monitoring without breaking existing adapters. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
chapel
added a commit
that referenced
this pull request
Feb 3, 2026
…thod to ChannelAdapter interface and implemented it in Discord adapter using client.ws.ping for WebSocket health monitoring. Includes 8 comprehensive tests covering all scenarios (not started, missing WS, wrong status, negative/excessive ping, healthy connection, edge cases, exceptions). All 1567 tests passing. Implementation follows optional method pattern for backward compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
healthCheck()method toChannelAdapterinterface for platform-specific health verificationhealthCheck()in Discord adapter usingclient.ws.pingto verify WebSocket connection healthChannelLifecycleManagerto call adapter'shealthCheck()method if availableChanges
Core Interface (
packages/core/src/types/channel-adapter.ts):healthCheck()method toChannelAdapterinterfaceDiscord Adapter (
packages/channels/src/adapters/discord/adapter.ts):healthCheck()method that:falseif adapter not startedLifecycle Manager (
packages/channels/src/lifecycle.ts):performHealthCheck()to calladapter.healthCheck()if availableTests (
packages/channels/test/adapters/discord/adapter.test.ts):Test Plan
Task: @01KGGTRK
🤖 Generated with Claude Code