fix(gateway): prevent Telegram duplicate messages and tool-trace leakage (#36965 #37555) - #38732
Closed
ashishpatel26 wants to merge 1 commit into
Conversation
Closes NousResearch#36965. When cursor-strip finalize edit fails (rate-limited), the prior streaming edits already delivered the content. Set _final_content_delivered=True so run.py suppression check fires and no duplicate sendMessage is triggered. Closes NousResearch#37555. _send_commentary had no guard against post-delivery calls. A stale commentary item drained after got_done could push a tool-trace line (e.g. 'Using web_search...') as a visible chat message. Add early return when _final_content_delivered or _final_response_sent is set. Adds 11 regression tests.
19 tasks
Contributor
|
Thanks for the regression analysis. This is an automated hermes-sweeper review; current
The PR's proposed |
1 task
This was referenced Aug 3, 2026
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.
Closes #36965. Closes #37555.
#36965: When cursor-strip finalize edit is rate-limited, _final_content_delivered stays False so run.py re-sends full response as duplicate. Fix: set flag when meaningful content was already in _last_sent_text.
#37555: _send_commentary had no guard; stale commentary items drained after delivery pushed tool-trace lines as visible messages. Fix: early-return False when delivery flags are set.
Adds 11 regression tests.