# NousResearch/hermes-agent · Feishu/Lark WebSocket disconnect and reconnect handling

## Open now

- 5 issues, 4 PRs open on GitHub.
- #24807: gateway/feishu: WS thread exit (ping timeout) is silently swallowed, should trigger in-process reconnect
- #31367: Feishu WebSocket disconnect causes full gateway restart every ~30min
- #46561: Feishu WebSocket does not reconnect after disconnect
- #53477: Feishu gateway: supervise Lark websocket receive-loop and reconnect in-process (1011 keepalive timeout → silently deaf agent)
- #64712: \[Bug\]: Feishu adapter stuck after Lark SDK WebSocket reconnect exhaustion
- PR #10620: fix(feishu): terminate process on unrecoverable websocket drops
- PR #10801: fix(feishu): WebSocket watchdog + approval card PATCH + markdown table rendering
- PR #53508: fix(feishu): reconnect when the websocket worker exits after startup
- PR #95252: fix(gateway): treat Feishu/Lark WebSocket close as transient (#67358)

These issues and fixes center on the Feishu/Lark gateway failing to recover from WebSocket disconnections, including zombie processes, silent failures, and missing in-process reconnect logic. Several fixes address detection of reconnect exhaustion, watchdog supervision of the receive loop, and proper reconnect triggering.

## TL;DR

- 17 member(s): 5 open issue(s), 3 closed issue(s), 4 open PR(s), 0 merged PR(s), 5 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.11`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #24807: gateway/feishu: WS thread exit (ping timeout) is silently swallowed, should trigger in-process reconnect
- #31367: Feishu WebSocket disconnect causes full gateway restart every ~30min
- #46561: Feishu WebSocket does not reconnect after disconnect
- #53477: Feishu gateway: supervise Lark websocket receive-loop and reconnect in-process (1011 keepalive timeout → silently deaf agent)
- #64712: \[Bug\]: Feishu adapter stuck after Lark SDK WebSocket reconnect exhaustion

## Closed / duplicate issues

- #10616: Feishu/Lark WebSocket drops lead to Zombie Gateway Process without auto-recovery
- #23491: \[Bug\]: Feishu WebSocket disconnect leaves gateway as zombie process — cron ticker stops, no auto-reconnect
- #67358: \[bug\] Lark WebSocket disconnect causes gateway process crash

## Prior & competing PRs

- **#24813: fix(gateway/feishu): in-process WS reconnect + fallback send strips thread_id**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#10620: fix(feishu): terminate process on unrecoverable websocket drops**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `5600105478ffde29d7566b45421b100eaa29c4ef`
  - files: `gateway/platforms/feishu.py`
- **#10801: fix(feishu): WebSocket watchdog + approval card PATCH + markdown table rendering**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#10251`, `#10251`, `#77364`
  - files: `gateway/platforms/feishu.py`, `gateway/run.py`, `tests/gateway/test_feishu.py`
- **#31386: fix(feishu): adapter-level WS reconnect on receive-loop death (#31367)**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#53508`
- **#53508: fix(feishu): reconnect when the websocket worker exits after startup**. open
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `1c1c31aeaf9a3a6b3d9737ad975714ed1c1ea234`
  - files: `plugins/platforms/feishu/adapter.py`, `tests/gateway/test_feishu.py`
- **#64741: fix(feishu): detect Lark SDK reconnect exhaustion and trigger reconnection**. closed without merge
  - maintainer direction: category `partial_fix`; implication `needs_llm`; refs `e67ae7421fea`, `#5500`, `#31386`, `#61271`, `#64741`, `#73202`, `#5500`, `#5665`, `#31386`, `#73202`, `#61271`, `#64741`, `#73202`, `#31386`, `#64741`, `#73202`, `#31386`, `#64741`, `#73202`, `#61271`, `#73202`, `#53508`, `#53508`, `#64741`, `#73202`, `#53508`, `#73202`, `#31367`, `#46561`, `#31386`, `#73202`, `#73202`, `#61271`, `#5500`, `#5665`, `#374151`, `#31367`, `#46561`, `#64712`, `#31386`, `#64741`, `#73202`
- **#67366: fix(gateway): treat Feishu/Lark WebSocket close as transient (#67358)**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#95252`
- **#73202: fix(feishu): notify gateway reconnect watcher on WS thread death**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#73779`, `#73779`
- **#95252: fix(gateway): treat Feishu/Lark WebSocket close as transient (#67358)**. open
  - maintainer direction: category `duplicate_of`; implication `duplicate`
  - files: `gateway/run.py`, `plugins/platforms/feishu/adapter.py`, `tests/gateway/test_feishu_ws_worker_loop.py`, `tests/gateway/test_loop_exception_handler.py`

## Fix status

- No merged fix on record.
- Subsystem: `gateway`
