mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-26 01:01:40 +00:00
Fix infinite interrupt loop in gateway by consuming pending messages with .pop() and clearing interrupt events before recursion
- Added logic to clear the adapter's interrupt event to prevent infinite loops during message processing. - Updated the get_pending_message method to pop messages from the pending queue, ensuring proper message handling.
This commit is contained in:
parent
62ba69a29d
commit
a32ad1a656
2 changed files with 8 additions and 1 deletions
|
|
@ -286,7 +286,7 @@ class BasePlatformAdapter(ABC):
|
|||
|
||||
def get_pending_message(self, session_key: str) -> Optional[MessageEvent]:
|
||||
"""Get and clear any pending message for a session."""
|
||||
return self._pending_messages.get(session_key)
|
||||
return self._pending_messages.pop(session_key, None)
|
||||
|
||||
def build_source(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue