fix(agent): add force_display to _emit_interim_assistant_message - #78100
Open
yingliang-zhang wants to merge 1 commit into
Open
fix(agent): add force_display to _emit_interim_assistant_message#78100yingliang-zhang wants to merge 1 commit into
yingliang-zhang wants to merge 1 commit into
Conversation
Add force_display: bool = False parameter to _emit_interim_assistant_message. When True: - Bypass _interim_text_was_delivered dedup gate (under stress with repeated verification candidates, near-identical interim texts were suppressed as 'already delivered', but the streaming buffer may have been flushed between first delivery and the dedup check) - Force already_streamed=False so messaging gateway calls on_commentary() (standalone permanent bubble) instead of on_segment_break() (paragraph separator that gets overwritten by subsequent messages) Wire force_display=True at verify_on_stop and pre_verify call sites in conversation_loop.py where the response MUST survive as a permanent UI element. Supersedes the closed NousResearch#62676 which introduced the same parameter but was not merged.
yingliang-zhang
force-pushed
the
fix/force-display-interim-message
branch
from
August 16, 2026 01:55
5501433 to
35ffc6b
Compare
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.
Problem
When
verify-on-stoporpre_verifytriggers, the agent produces a complete response that is emitted via_emit_interim_assistant_message. However, two issues can cause the response to be lost:Dedup gate false-negative:
_interim_text_was_delivered()may return True if similar text was previously recorded as delivered, suppressing the callback entirely. Under stress (repeated verification candidates, compaction), the Desktop streaming buffer may have been flushed between the first delivery and the dedup check.Streaming buffer overwrite on messaging gateways:
_interim_content_was_streamed()returns True when the text was already streamed viastream_delta_callback. On messaging gateways (Telegram/Discord/Slack),already_streamed=Trueroutes toon_segment_break()(paragraph separator, no text payload) instead ofon_commentary()(standalone permanent bubble). The streamed text lives in a transient buffer and gets overwritten by subsequent verification messages.This was previously identified in #62676 (Layer 3), which was closed without merge.
Fix
Add
force_display: bool = Falseparameter to_emit_interim_assistant_message:True: bypass_interim_text_was_delivereddedup gate + forcealready_streamed=Falseforce_display=Trueat theverify_on_stopandpre_verifycall sites where the response must survive as a permanent UI elementTest plan
pytest tests/agent/test_verification_stop.py tests/agent/test_verification_stop_caching.py tests/run_agent/test_verification_continuation_budget.py tests/tui_gateway/test_interim_assistant_callback.py— 25 passedpy_compile— OKRelated