mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
fix: add pre_start() to _IncomingHandler for dingtalk SDK compatibility
The dingtalk-stream SDK calls pre_start() on every registered handler before opening the WebSocket connection. Without this method, the SDK raises AttributeError and kills the stream connection, causing DingTalk to be unable to connect via Stream Mode.
This commit is contained in:
parent
7267c38695
commit
e3293c007f
1 changed files with 10 additions and 0 deletions
|
|
@ -1395,6 +1395,16 @@ class _IncomingHandler(
|
|||
self._adapter = adapter
|
||||
self._loop = loop
|
||||
|
||||
def pre_start(self) -> None:
|
||||
"""No-op pre-start hook required by dingtalk-stream SDK.
|
||||
|
||||
The SDK calls ``pre_start()`` on every registered handler before
|
||||
opening the WebSocket connection. Without this method, the SDK
|
||||
raises ``AttributeError: '_IncomingHandler' object has no
|
||||
attribute 'pre_start'`` and kills the stream connection.
|
||||
"""
|
||||
return
|
||||
|
||||
async def process(self, message: "CallbackMessage"):
|
||||
"""Called by dingtalk-stream (>=0.20) when a message arrives.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue