From b3af59fc8e09fd6acc0af8f0bddcadec64ce7d42 Mon Sep 17 00:00:00 2001 From: "zhangxiaoyu.york" Date: Sun, 1 Mar 2026 00:20:32 +0800 Subject: [PATCH 1/3] bugfix: remove client.stop --- nanobot/channels/feishu.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.py index 4a6312e..4abac85 100644 --- a/nanobot/channels/feishu.py +++ b/nanobot/channels/feishu.py @@ -311,8 +311,8 @@ class FeishuChannel(BaseChannel): self._ws_client.start() except Exception as e: logger.warning("Feishu WebSocket error: {}", e) - if self._running: - import time; time.sleep(5) + if self._running: + import time; time.sleep(5) self._ws_thread = threading.Thread(target=run_ws, daemon=True) self._ws_thread.start() @@ -327,11 +327,6 @@ class FeishuChannel(BaseChannel): async def stop(self) -> None: """Stop the Feishu bot.""" self._running = False - if self._ws_client: - try: - self._ws_client.stop() - except Exception as e: - logger.warning("Error stopping WebSocket client: {}", e) logger.info("Feishu bot stopped") def _add_reaction_sync(self, message_id: str, emoji_type: str) -> None: From 5d829ca575464214b18b8af27d326a2db967e922 Mon Sep 17 00:00:00 2001 From: "zhangxiaoyu.york" Date: Sun, 1 Mar 2026 00:30:03 +0800 Subject: [PATCH 2/3] bugfix: remove client.stop --- nanobot/channels/feishu.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.py index 4abac85..161d31e 100644 --- a/nanobot/channels/feishu.py +++ b/nanobot/channels/feishu.py @@ -325,7 +325,13 @@ class FeishuChannel(BaseChannel): await asyncio.sleep(1) async def stop(self) -> None: - """Stop the Feishu bot.""" + """ + Stop the Feishu bot. + + Notice: lark.ws.Client does not expose stop method, simply exiting the program will close the client. + + Reference: https://github.com/larksuite/oapi-sdk-python/blob/v2_main/lark_oapi/ws/client.py#L86 + """ self._running = False logger.info("Feishu bot stopped") From 9e2f69bd5a069c8e7b7a2288fa7e004a4409cec5 Mon Sep 17 00:00:00 2001 From: "zhangxiaoyu.york" Date: Sun, 1 Mar 2026 00:51:17 +0800 Subject: [PATCH 3/3] tidy up --- nanobot/channels/feishu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.py index 161d31e..16c6a07 100644 --- a/nanobot/channels/feishu.py +++ b/nanobot/channels/feishu.py @@ -311,8 +311,8 @@ class FeishuChannel(BaseChannel): self._ws_client.start() except Exception as e: logger.warning("Feishu WebSocket error: {}", e) - if self._running: - import time; time.sleep(5) + if self._running: + import time; time.sleep(5) self._ws_thread = threading.Thread(target=run_ws, daemon=True) self._ws_thread.start()