mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(gateway): use source.thread_id instead of undefined event in queued response
In _run_agent(), the pending message handler references 'event' which is not defined in that scope — it only exists in the caller. This causes a NameError when sending the first response before processing a queued follow-up message. Replace getattr(event, 'metadata', None) with the established pattern using source.thread_id, consistent with lines 2625, 2810, 3678, 4410, 4566 in the same file.
This commit is contained in:
parent
4bede272cf
commit
0f1a53382e
1 changed files with 1 additions and 1 deletions
|
|
@ -8131,7 +8131,7 @@ class GatewayRunner:
|
|||
if first_response and not _already_streamed:
|
||||
try:
|
||||
await adapter.send(source.chat_id, first_response,
|
||||
metadata=getattr(event, "metadata", None))
|
||||
metadata={"thread_id": source.thread_id} if source.thread_id else None)
|
||||
except Exception as e:
|
||||
logger.warning("Failed to send first response before queued message: %s", e)
|
||||
# else: interrupted — discard the interrupted response ("Operation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue