agentscope-ai / agentscope-ai/QwenPaw
[BUG][Feishu Channel] WebSocket connection drops without auto-reconnect
- Langage dominant
- Python
- Étoiles
- 34.9k
- Forks
- 3.1k
- Merge moyen
- 1 j 15 h
- PR mergées (30 j)
- 225
Description
## Bug Description
Feishu channel WebSocket long connection drops after running for some time (6-24 hours), but the system does not auto-reconnect, causing no response to user messages. Restarting CoPaw restores functionality.
## Impact
- All users using Feishu/Lark channel
- P0 critical bug
## Reproduction Steps
1. Start CoPaw: `copaw start`
2. Confirm Feishu channel works
3. Let service run for 6-24 hours
4. Send message to bot in Feishu
5. Expected: Bot replies
6. Actual: No response
7. Restart CoPaw restores functionality
## Root Cause
Code location: `copaw/app/channels/feishu/channel.py`
**Issue 1: No Heartbeat** - WebSocket server closes idle connections, but CoPaw has no heartbeat
**Issue 2: No Auto-Reconnect** - `start()` called only once, no reconnect logic
**Issue 3: No State Callbacks** - Missing on_close, on_error callbacks
**Issue 4: No Timeout Detection** - No last message time check
## Log Evidence
Normal: `feishu WebSocket connecting...` then message logs
After disconnect: No logs even with user messages
After restart: Recovers
## Suggested Fixes
1. Add heartbeat loop (every 30 seconds)
2. Add auto-reconnect mechanism with retry
3. Use SDK auto-reconnect if supported
4. Add connection state monitoring
## Environment
- CoPaw: 0.2.0.post1
- OS: Windows 10
- Python: 3.10
## Severity: P0 Critical Bug
## Temporary Workaround
Daily restart: `0 3 * * * copaw restart`
Report Date: 2026-03-26
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.