fix(desktop): keep interim assistant narration on message.complete#61997
Closed
giggling-ginger wants to merge 3 commits into
Closed
fix(desktop): keep interim assistant narration on message.complete#61997giggling-ginger wants to merge 3 commits into
giggling-ginger wants to merge 3 commits into
Conversation
…ing mid-turn narration Desktop collapsed a multi-step turn to only the final message on message.complete, dropping every interim assistant text segment streamed between tool calls. The text is persisted and reappears on reload, and every other surface (messaging gateway, Ink TUI, Desktop's own reload path) keeps it — Desktop's live-completion path was the sole outlier and never consulted the existing display.interim_assistant_messages setting. Wire the setting through to completion (default true) and extract the merge into a pure, tested mergeFinalAssistantText() that keeps interim narration and upgrades the trailing segment in place, matching the TUI/reload contract. Also clarify the interim_assistant_messages comments in config.py and cli-config.yaml.example (comment-only; no default change). Salvaged from NousResearch#61447 (lucasfdale). Fixes NousResearch#61822. Fixes NousResearch#54905. Fixes NousResearch#61297.
Collaborator
Related: salvage of concurrent OPEN PR #61447 (@lucasfdale, authorship preserved via cherry-pick — same |
Keep lucasfdale entry alongside newly added upstream AUTHOR_MAP rows.
Contributor
Author
|
Closing in favor of the original fix PR #61447. #61997 was only a salvage cherry-pick of @lucasfdale's work onto current main to attach #61822. No independent code changes beyond AUTHOR_MAP. Prefer merging #61447 directly and linking the issue there rather than duplicating the PR surface. See review note on #61447. |
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.
What does this PR do?
On Desktop, a multi-step turn (
text → tool → text → tool → …) streams mid-turnnarration live, then collapses to only the final message the instant
message.completelands. Tool activity and intermediate assistant text flashfor a split second and then disappear — exactly the symptom reported in #61822.
Root cause:
completeAssistantMessageused an unconditionalreplaceTextPartthat dropped every
textpart and re-appended onlymessage.complete.text(the agent's last assistant segment). Desktop'slive-completion path was the sole outlier: messaging gateway, Ink TUI, and
Desktop's own reload path already keep interim text.
This wires Desktop to honor the existing
display.interim_assistant_messagessetting (default
true) and merges final text without discarding earliernarration.
Related Issue
Fixes #61822. Also Fixes #54905 and #61297 (same Desktop root cause).
Salvaged from concurrent PR #61447 by @lucasfdale (authorship preserved via
cherry-pick). Closed auto-PR #61866 was empty/broken and not used.
Type of Change
Changes Made
apps/desktop/src/lib/chat-messages.ts— puremergeFinalAssistantText(parts, finalText, keepInterim)apps/desktop/src/app/session/hooks/use-message-stream/index.ts— use merge + config atom instead of drop-all-textapps/desktop/src/store/session.ts—$keepInterimAssistantMessagesatom (default true)apps/desktop/src/app/session/hooks/use-hermes-config.ts— set atom fromconfig.display.interim_assistant_messagescli-config.yaml.example+hermes_cli/config.pyHow to Test
display.interim_assistant_messages: falserestores lean collapseChecklist