fix(gateway): add queue_message method to prevent message loss on interrupt depth cap#1
Open
SpencerLin922 wants to merge 1 commit into
Open
fix(gateway): add queue_message method to prevent message loss on interrupt depth cap#1SpencerLin922 wants to merge 1 commit into
SpencerLin922 wants to merge 1 commit into
Conversation
…errupt depth cap When interrupt recursion depth reaches MAX_INTERRUPT_DEPTH, pending messages were being popped from _pending_messages but could not be re-queued because queue_message() method did not exist on BasePlatformAdapter. This caused messages to be silently dropped. Added queue_message(session_key, message_text) to re-queue a message as a MessageEvent for processing on the next turn. Fixes the silent message loss described in issue NousResearch#816.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When interrupt recursion depth reaches MAX_INTERRUPT_DEPTH (3), pending messages were being popped from _pending_messages but could not be re-queued because the queue_message() method did not exist on BasePlatformAdapter. This caused messages to be silently dropped.
Added queue_message(session_key, message_text) to re-queue a message as a MessageEvent for processing on the next turn.
Bug Details
In run.py line 5573-5574:
The hasattr check was failing (method didn't exist), so pending messages were lost when:
Fix
Added queue_message() method to BasePlatformAdapter in gateway/platforms/base.py that creates a new MessageEvent and stores it in _pending_messages for processing on the next turn.
Test Plan
Closes NousResearch#816