mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(gateway): bypass text batching when delay is 0 (#6996)
The text batching feature routes TEXT messages through asyncio.create_task() + asyncio.sleep(delay). Even with delay=0, the task fires asynchronously and won't complete before synchronous test assertions. This broke 33 tests across Discord, Matrix, and WeCom adapters. When _text_batch_delay_seconds is 0 (the test fixture setting), dispatch directly to handle_message() instead of going through the async batching path. This preserves the pre-batching behavior for tests while keeping batching active in production (default delay 0.6s).
This commit is contained in:
parent
d5023d36d8
commit
13d7ff3420
3 changed files with 3 additions and 3 deletions
|
|
@ -1101,7 +1101,7 @@ class MatrixAdapter(BasePlatformAdapter):
|
|||
self._background_read_receipt(room.room_id, event.event_id)
|
||||
|
||||
# Only batch plain text messages — commands dispatch immediately.
|
||||
if msg_type == MessageType.TEXT:
|
||||
if msg_type == MessageType.TEXT and self._text_batch_delay_seconds > 0:
|
||||
self._enqueue_text_event(msg_event)
|
||||
else:
|
||||
await self.handle_message(msg_event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue