fix(feishu): add WebSocket pingTimeout and lifecycle event logging#40
Open
yyteen-bot wants to merge 1 commit into
Open
fix(feishu): add WebSocket pingTimeout and lifecycle event logging#40yyteen-bot wants to merge 1 commit into
yyteen-bot wants to merge 1 commit into
Conversation
The Feishu adapter's WSClient was created without a pingTimeout, causing the Lark SDK to never detect half-open WebSocket connections. This led to bots becoming unresponsive after idle periods (several hours) without any error logs. The Lark SDK's pingTimeout defaults to 0 (disabled), meaning the pong watchdog is never armed. When a WebSocket connection silently drops (e.g., due to NAT timeout, firewall, or WSL network sleep), the SDK never detects it and never triggers reconnection. Changes: - Add pingTimeout config option (default: 30s) to enable dead connection detection - Add WSClient lifecycle event callbacks for visibility into connection state - Fix stop() to properly close WebSocket before releasing references - Expose pingTimeout as configurable via golem.yaml Fixes 0xranx#28
Owner
|
Thanks for the fix direction. I landed this in main with a small adjustment: the newer Lark SDK expects |
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.
The Feishu adapter's WSClient was created without a pingTimeout, causing the Lark SDK to never detect half-open WebSocket connections. This led to bots becoming unresponsive after idle periods (several hours) without any error logs.
The Lark SDK's pingTimeout defaults to 0 (disabled), meaning the pong watchdog is never armed. When a WebSocket connection silently drops (e.g., due to NAT timeout, firewall, or WSL network sleep), the SDK never detects it and never triggers reconnection.
Changes:
Fixes #28
What does this PR do?
Fixes Feishu bot becoming unresponsive after idle periods by enabling the Lark SDK's WebSocket pong watchdog (
pingTimeout). Without this, half-open WebSocket connections (caused by NAT timeout, firewall, or WSL network sleep) are never detected, and the SDK never triggers reconnection.Configuration