deerflow2/backend/app/channels
Ryker_Feng c91dacc8e2
fix(channels): surface WeCom WebSocket connection failures (#2000) (#3526)
* fix(channels): surface WeCom WebSocket connection failures (#2000)

The WeCom channel started the SDK connection with a fire-and-forget
asyncio task and never inspected its result, so connection failures
(e.g. the gateway WebSocket handshake to wss://openws.work.weixin.qq.com
failing) were silently swallowed: the channel still logged "started",
SDK error/disconnected events went unobserved, and the connect task
produced "Task exception was never retrieved" noise.

Monitor the connect task with a done-callback that logs a clear,
actionable error (and stays silent on cancellation), and subscribe to
the SDK's error/disconnected events so failures become visible in
DeerFlow's own logs.

* style(channels): apply ruff format to wecom.py

Collapse the multiline log message onto a single line to satisfy the
CI ruff formatter (lint-backend was failing on format --check).

* fix(channels): log WeCom disconnect reason when SDK provides one

Address review feedback: _on_ws_disconnected now includes the first
event arg (e.g. reason/context) in the warning instead of discarding
it, so disconnect causes are visible in logs.
2026-06-13 22:34:00 +08:00
..
__init__.py Refactor DeerFlow to use Gateway's LangGraph-compatible API 2026-04-26 20:38:34 +08:00
base.py feat(channels): add DingTalk channel integration (#2628) 2026-04-30 11:25:33 +08:00
commands.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
connection_identity.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
dingtalk.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
discord.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
feishu.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
manager.py feat(telegram): stream agent replies by editing the placeholder message in place (#3534) 2026-06-13 08:38:28 +08:00
message_bus.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
runtime_config_store.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
service.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
slack.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
store.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
telegram.py feat(telegram): stream agent replies by editing the placeholder message in place (#3534) 2026-06-13 08:38:28 +08:00
wechat.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
wecom.py fix(channels): surface WeCom WebSocket connection failures (#2000) (#3526) 2026-06-13 22:34:00 +08:00