You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: [Bug][Windows Desktop] Long assistant messages partially disappear from UI — first half truncated, restored on restart #46606
On Windows 11 desktop, when a long assistant response (combined with large tool call results) exceeds some display threshold, the first half of the message is completely removed from the visible chat area. Only the second half remains. The truncated content is not collapsed or scrollable — it simply does not appear.
Steps to Reproduce
Use Hermes Desktop v0.16.0 on Windows 11
Use a model that produces long responses (tested with deepseek-v4-pro)
Use delegate_task with two parallel tasks that both return detailed summaries (each >800 tokens)
Include a long-form assistant response after the tool results
Observe: as the message renders, the top portion of the assistant's reply disappears once the full length is loaded
Expected Behavior
The entire message should be visible and scrollable within the chat view.
Actual Behavior
The first half disappears; only the tail end is displayed.
I'd like to take a look at this. The issue seems related to the streaming Markdown rendering pipeline, particularly the \indStableBoundary\ / \enceOpenAt\ logic in \streamingMarkdown.tsx\ that splits text into stable/unstable prefixes. When long tool results are embedded in assistant messages, the boundary detection might incorrectly lock a too-large prefix, causing the first half to disappear. I'll investigate and submit a fix.
Confirming on macOS — this is not Windows-specific.
Hitting the identical symptom on the macOS Desktop app v0.15.1: long assistant messages render with the first half missing, only the tail visible, not collapsed and not scrollable.
Two additions to the report:
Cross-platform — reproduced on macOS (Apple Silicon), so this isn't a Windows-only issue. Triggered by ordinary long assistant replies (~400+ lines / >16k chars), no delegate_task or parallel tool results needed.
Likely related code (ui-tui/src/lib/text.ts): boundedLiveRenderText → boundedRenderText with LIVE_RENDER_MAX_CHARS = 16_000 / LIVE_RENDER_MAX_LINES = 240 keeps the tail and drops the head. The completed-message path in messageLine.tsx renders the full msg.text via <Md>, so if the head is still missing post-turn, the truncation may be happening upstream in how the finished turn's text is committed to the transcript buffer — worth checking whether the live tail bound is leaking into the persisted segment.
Thanks for the additional analysis — the PR #46650 should address both the virtual list rendering and the prefix boundary issues you identified. Appreciate the cross-platform confirmation.
Same issue:
Desktop: assistant messages that precede tool calls are erased from the display on turn completion
Summary
In the Desktop app, when an assistant turn consists of multiple messages — text, then one or more tool calls, then a final reply — the app displays only the final message once the turn completes. Every assistant message with finish_reason = "tool_calls" (i.e., the narration the model writes before each tool call) is removed from the display.
Crucially, this is a display-only retraction, not data loss: the erased messages are persisted normally in state.db with active = 1. So the content survives on disk — it is simply hidden from the user after being shown live during streaming. The effect is a UI that shows an answer and then retracts it.
Impact
Models that narrate before acting lose most of their visible voice. The pre-tool messages frequently contain the assistant's decision-making and rationale — why it's about to run a command, how it's interpreting a result, what it will do next. Erasing them:
removes the user's insight into the agent's reasoning,
makes the interface feel untrustworthy ("responds, then deletes the response"),
is especially severe with reasoning-forward / verbose models, where the pre-tool narration is often the most valuable part of the turn.
It is far less noticeable with models that fold most of their output into a single final message, which is likely why it hasn't been widely flagged.
Environment
Hermes Desktop v0.18.2
OS: Windows 11
Model: MiniMax M3 (minimax-m3), via the OpenCode Go provider
Reproduced consistently across multiple turns.
Steps to reproduce
Use a model that emits assistant text before calling a tool (MiniMax M3 does this on nearly every tool-using turn).
Send a prompt whose answer requires the assistant to narrate, then use one or more tools, then reply (e.g., "explain what you'll do, then run and report back").
Watch the message during streaming, then after it completes.
Expected behavior
Pre-tool assistant messages remain accessible after the turn completes — shown inline, or collapsed into an expandable section. Since the content is persisted, it should never be erased from view.
Actual behavior
When the turn finishes on a finish_reason = "stop" message, all preceding assistant messages with finish_reason = "tool_calls" disappear from the display. There is no chevron and no collapse — they are removed entirely. Only the final stop message remains visible.
Evidence (message structure of one real turn)
A single logical turn produced 8 messages. The user saw only the last one; the two substantive assistant messages (★) were erased from the display but are present in state.db with active = 1:
#
role
finish_reason
tool
shown to user?
1
user
—
—
✅
2
assistant ★
tool_calls
—
❌ erased (persisted, active=1)
3
tool
—
terminal
—
4
assistant
tool_calls
— (empty text)
—
5
tool
—
read_file
—
6
assistant ★
tool_calls
—
❌ erased (persisted, active=1)
7
tool
—
fact_store
—
8
assistant
stop
—
✅ only message shown
Both erased messages (#2, #6) carried substantial text (hundreds to >1,000 characters of the model's own decision/ratification prose) and are queryable in state.db after the fact:
-- the erased content is still there, active, just not displayedSELECT id, role, finish_reason, length(content), active
FROM messages
WHERE role ='assistant'AND finish_reason ='tool_calls'AND active =1
ORDER BY id DESC;
(Synthetic illustration of what an erased pre-tool message looks like: assistant writes "Good call — I'll run the check now and read the result." → calls a tool → on completion this line vanishes, leaving only the closing summary.)
Suggested fix
Render persisted assistant messages that precede tool calls as part of the turn transcript — inline, or collapsed into an expandable "Thinking / steps" section (comparable to how the TUI keeps display.sections.thinking visible). Never remove persisted content from the display once it has been shown. Even a collapsed-but-present treatment would resolve it.
Notes
The TUI has per-section visibility controls (display.details_mode, display.sections.<name>, /details …); the Desktop app appears to have no equivalent, and defaults to erasing pre-tool assistant messages.
Because the data layer already persists these messages correctly, this looks isolated to the Desktop renderer's handling of multi-message (pre-tool) turns.
Root cause (Desktop live path):mergeFinalAssistantText replaced alltext parts in the live assistant bubble with message.complete text. Complete payloads are usually only the last model reply. When earlier narration shared the bubble with tools and message.interim did not seal it first, the pre-tool half vanished on turn end (still present in state.db → reappeared after restart).
Fix: treat tool/image parts as segment boundaries; only supersede the open trailing segment. Falls back to full replace when the final already restates sealed narration (no duplicates).
Vitest: chat-messages.test.ts + interim-sealing.test.tsx — 49 passed on Windows 11.
One PR addresses a concrete completion-time failure reported under #46606: persisted pre-tool assistant narration disappears from the live Desktop transcript when the final payload replaces earlier text segments. #69202 does not establish or fix the cause of the separately reported long-message head truncation, so that symptom remains unverified as an independent path.
Related pull requests
fix(desktop): preserve pre-tool assistant text on turn complete #69202best fix — (+277/-23) — partial fix: Changes mergeFinalAssistantText to preserve text sealed by tool/image boundaries while replacing only the trailing open segment, with unit and stream tests covering narration → tool → final completion, multiple tools, empty finals, and deduplication edge cases. This directly addresses the documented completion-time narration loss, but the diff provides no evidence that it resolves long-message truncation without tool-segment reconciliation.
Suggested consolidation
Merge #69202 as the verified best scoped fix for completion-time pre-tool narration loss; there are no listed duplicate PRs to close. Keep #46606 open after merging until the original long-message reproduction is retested and its remaining cause is verified; the reporter’s live-render-bound explanation is only a hypothesis, while the issue also contains the concrete completion-time path fixed here.
Complex graph
flowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I46590(["issue #46590 (closed)"])
I46606(["issue #46606 (open)"])
P69202["PR #69202 (open)"]
P69202 -->|best fix| I46606
P69202 -->|best fix| I46590
class I46590 closed
class I46606 open
class I46606 target
class P69202 open
class P69202 best
class P69202 best
click I46590 "https://github.com/NousResearch/hermes-agent/issues/46590"
click I46606 "https://github.com/NousResearch/hermes-agent/issues/46606"
click P69202 "https://github.com/NousResearch/hermes-agent/pull/69202"
Loading
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 1 pull request and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 15 kB of PR diffs, 5 kB of issue/PR text, 8 kB of discussion (5 comments), 4 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
Still reproducible on Windows 11 / Hermes Desktop v0.20.1
Confirming the pre-tool narration wipe path is still reachable on current main (460d34525b, Hermes v0.20.1) with OpenAI Codex / gpt-5.6-sol.
Observed behavior:
A tool-using turn streams assistant commentary and tool cards normally.
The assistant text is visible briefly.
During/after turn settlement, the text disappears while the tool card / Thought rows remain.
Sometimes the full content reappears after waiting several seconds to about a minute; restarting Hermes Desktop restores it reliably, consistent with the content remaining durable rather than being lost.
Occurrence is intermittent.
The screenshot from the affected turn shows a completed skill_manage card and interim timeline rows still rendered while the assistant output region is missing. The local semantic-highlighting plugin was checked and only changes color, font weight, link decoration, and focus outline; it has no visibility/removal rules.
Code-level reproduction against the installed source:
constparts=[{type: 'text',text: 'I will inspect the renderer first.'},{type: 'tool-call',toolCallId: 'tool-1',toolName: 'read_file',args: {},argsText: '{}',result: {}},{type: 'text',text: 'The final reply is streaming.'}]constsettled=mergeFinalAssistantText(parts,'The final reply.')
Expected visible text:
I will inspect the renderer first.
The final reply.
Actual visible text:
The final reply.
A temporary Vitest regression for that case fails with:
expected [ 'The final reply.' ] to deeply equal
[ 'I will inspect the renderer first.', 'The final reply.' ]
Current mergeFinalAssistantText explicitly removes every text part in the live bubble, relying on earlier narration having been sealed into separate bubbles. This suggests the residual intermittent path occurs when message.interim is absent, delayed, or loses a race. PR #69202's segment-boundary fallback appears directly scoped to this remaining path, although its branch is now behind current main and would need rebasing/transplanting.
Fixed on main by #118890 (01d934f). Completion now replaces only the text after the last tool call, so narration written before tool calls stays visible after the turn ends; before, it was dropped until a restart. Covered by response-occurrences.test.tsx. Please reopen with a current build if long replies still lose their start.
Activity
szzhoujiarui-sketch commentedon Jun 15, 2026
I'd like to take a look at this. The issue seems related to the streaming Markdown rendering pipeline, particularly the \indStableBoundary\ / \enceOpenAt\ logic in \streamingMarkdown.tsx\ that splits text into stable/unstable prefixes. When long tool results are embedded in assistant messages, the boundary detection might incorrectly lock a too-large prefix, causing the first half to disappear. I'll investigate and submit a fix.
fix(tui): prevent long streaming messages from being truncated
edoecohen commentedon Jun 17, 2026
Confirming on macOS — this is not Windows-specific.
Hitting the identical symptom on the macOS Desktop app v0.15.1: long assistant messages render with the first half missing, only the tail visible, not collapsed and not scrollable.
Two additions to the report:
Cross-platform — reproduced on macOS (Apple Silicon), so this isn't a Windows-only issue. Triggered by ordinary long assistant replies (~400+ lines / >16k chars), no
delegate_taskor parallel tool results needed.Not recovered by scrolling, and not always recovered after flush — [Bug]: Live streaming text silently truncated by boundedLiveRenderText with no way to expand #18448 states the full text "becomes visible after the segment is flushed." In my experience the beginning stays gone even after the turn completes and even when scrolling back up to the finished message. This suggests the loss isn't purely a live-streaming
boundedLiveRenderTexttail-window artifact ([Bug]: Live streaming text silently truncated by boundedLiveRenderText with no way to expand #18448) but also affects the persisted/rendered transcript node for completed messages.Likely related code (
ui-tui/src/lib/text.ts):boundedLiveRenderText→boundedRenderTextwithLIVE_RENDER_MAX_CHARS = 16_000/LIVE_RENDER_MAX_LINES = 240keeps the tail and drops the head. The completed-message path inmessageLine.tsxrenders the fullmsg.textvia<Md>, so if the head is still missing post-turn, the truncation may be happening upstream in how the finished turn's text is committed to the transcript buffer — worth checking whether the live tail bound is leaking into the persisted segment.Env: macOS 26.5.1 (Apple Silicon) · Hermes Desktop v0.15.1
szzhoujiarui-sketch commentedon Jun 17, 2026
Thanks for the additional analysis — the PR #46650 should address both the virtual list rendering and the prefix boundary issues you identified. Appreciate the cross-platform confirmation.
mxcrowe commentedon Jul 11, 2026
Same issue:
Desktop: assistant messages that precede tool calls are erased from the display on turn completion
Summary
In the Desktop app, when an assistant turn consists of multiple messages — text, then one or more tool calls, then a final reply — the app displays only the final message once the turn completes. Every assistant message with
finish_reason = "tool_calls"(i.e., the narration the model writes before each tool call) is removed from the display.Crucially, this is a display-only retraction, not data loss: the erased messages are persisted normally in
state.dbwithactive = 1. So the content survives on disk — it is simply hidden from the user after being shown live during streaming. The effect is a UI that shows an answer and then retracts it.Impact
Models that narrate before acting lose most of their visible voice. The pre-tool messages frequently contain the assistant's decision-making and rationale — why it's about to run a command, how it's interpreting a result, what it will do next. Erasing them:
It is far less noticeable with models that fold most of their output into a single final message, which is likely why it hasn't been widely flagged.
Environment
minimax-m3), via the OpenCode Go providerSteps to reproduce
Expected behavior
Pre-tool assistant messages remain accessible after the turn completes — shown inline, or collapsed into an expandable section. Since the content is persisted, it should never be erased from view.
Actual behavior
When the turn finishes on a
finish_reason = "stop"message, all preceding assistant messages withfinish_reason = "tool_calls"disappear from the display. There is no chevron and no collapse — they are removed entirely. Only the finalstopmessage remains visible.Evidence (message structure of one real turn)
A single logical turn produced 8 messages. The user saw only the last one; the two substantive assistant messages (★) were erased from the display but are present in
state.dbwithactive = 1:tool_callstool_callstool_callsstopBoth erased messages (#2, #6) carried substantial text (hundreds to >1,000 characters of the model's own decision/ratification prose) and are queryable in
state.dbafter the fact:(Synthetic illustration of what an erased pre-tool message looks like: assistant writes "Good call — I'll run the check now and read the result." → calls a tool → on completion this line vanishes, leaving only the closing summary.)
Suggested fix
Render persisted assistant messages that precede tool calls as part of the turn transcript — inline, or collapsed into an expandable "Thinking / steps" section (comparable to how the TUI keeps
display.sections.thinkingvisible). Never remove persisted content from the display once it has been shown. Even a collapsed-but-present treatment would resolve it.Notes
display.details_mode,display.sections.<name>,/details …); the Desktop app appears to have no equivalent, and defaults to erasing pre-tool assistant messages.erict16 commentedon Jul 22, 2026
Opened a fix PR: #69202
Root cause (Desktop live path):
mergeFinalAssistantTextreplaced alltextparts in the live assistant bubble withmessage.completetext. Complete payloads are usually only the last model reply. When earlier narration shared the bubble with tools andmessage.interimdid not seal it first, the pre-tool half vanished on turn end (still present instate.db→ reappeared after restart).Fix: treat tool/image parts as segment boundaries; only supersede the open trailing segment. Falls back to full replace when the final already restates sealed narration (no duplicates).
Vitest:
chat-messages.test.ts+interim-sealing.test.tsx— 49 passed on Windows 11.GottZ commentedon Jul 27, 2026
Summary
One PR addresses a concrete completion-time failure reported under #46606: persisted pre-tool assistant narration disappears from the live Desktop transcript when the final payload replaces earlier text segments. #69202 does not establish or fix the cause of the separately reported long-message head truncation, so that symptom remains unverified as an independent path.
Related pull requests
best fix— (+277/-23) — partial fix: ChangesmergeFinalAssistantTextto preserve text sealed by tool/image boundaries while replacing only the trailing open segment, with unit and stream tests covering narration → tool → final completion, multiple tools, empty finals, and deduplication edge cases. This directly addresses the documented completion-time narration loss, but the diff provides no evidence that it resolves long-message truncation without tool-segment reconciliation.Suggested consolidation
Merge #69202 as the verified best scoped fix for completion-time pre-tool narration loss; there are no listed duplicate PRs to close. Keep #46606 open after merging until the original long-message reproduction is retested and its remaining cause is verified; the reporter’s live-render-bound explanation is only a hypothesis, while the issue also contains the concrete completion-time path fixed here.
Complex graph
flowchart LR classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937 classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151 classDef best stroke-width:3px,stroke:#b45309 classDef target stroke-width:3px,stroke:#4338ca I46590(["issue #46590 (closed)"]) I46606(["issue #46606 (open)"]) P69202["PR #69202 (open)"] P69202 -->|best fix| I46606 P69202 -->|best fix| I46590 class I46590 closed class I46606 open class I46606 target class P69202 open class P69202 best class P69202 best click I46590 "https://github.com/NousResearch/hermes-agent/issues/46590" click I46606 "https://github.com/NousResearch/hermes-agent/issues/46606" click P69202 "https://github.com/NousResearch/hermes-agent/pull/69202"Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 1 pull request and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 15 kB of PR diffs, 5 kB of issue/PR text, 8 kB of discussion (5 comments), 4 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
PhanAnh-V commentedon Aug 16, 2026
Still reproducible on Windows 11 / Hermes Desktop v0.20.1
Confirming the pre-tool narration wipe path is still reachable on current
main(460d34525b, Hermesv0.20.1) with OpenAI Codex /gpt-5.6-sol.Observed behavior:
The screenshot from the affected turn shows a completed
skill_managecard and interim timeline rows still rendered while the assistant output region is missing. The local semantic-highlighting plugin was checked and only changescolor, font weight, link decoration, and focus outline; it has no visibility/removal rules.Code-level reproduction against the installed source:
Expected visible text:
Actual visible text:
A temporary Vitest regression for that case fails with:
The existing focused suites pass (
82/82):Current
mergeFinalAssistantTextexplicitly removes everytextpart in the live bubble, relying on earlier narration having been sealed into separate bubbles. This suggests the residual intermittent path occurs whenmessage.interimis absent, delayed, or loses a race. PR #69202's segment-boundary fallback appears directly scoped to this remaining path, although its branch is now behind currentmainand would need rebasing/transplanting.OutThisLife commentedon Sep 23, 2026
Fixed on main by #118890 (01d934f). Completion now replaces only the text after the last tool call, so narration written before tool calls stays visible after the turn ends; before, it was dropped until a restart. Covered by response-occurrences.test.tsx. Please reopen with a current build if long replies still lose their start.