Skip to content

[Bug]: [Bug][Windows Desktop] Long assistant messages partially disappear from UI — first half truncated, restored on restart #46606

Closed

Description

@Hugh-24041820

Bug Description

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

  1. Use Hermes Desktop v0.16.0 on Windows 11
  2. Use a model that produces long responses (tested with deepseek-v4-pro)
  3. Use delegate_task with two parallel tasks that both return detailed summaries (each >800 tokens)
  4. Include a long-form assistant response after the tool results
  5. 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.

Affected Component

Other

Messaging Platform (if gateway-related)

No response

Debug Report

- Report: https://paste.rs/kdPzH
- agent.log: https://dpaste.com/AW58SRZJ2
- desktop.log: https://paste.rs/VXS4T

Operating System

Windows 11 (Home)

Python Version

No response

Hermes Version

0.16.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Activity

  1. added
    type/bugSomething isn't working
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    comp/gatewayGateway runner, session dispatch, delivery
    P2Medium — degraded but workaround exists
    on Jun 15, 2026
  2. szzhoujiarui-sketch commented on Jun 15, 2026

    @szzhoujiarui-sketch

    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.

  3. added a commit that references this issue on Jun 15, 2026
    bac6693
  4. edoecohen commented on Jun 17, 2026

    @edoecohen

    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:

    1. 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.

    2. 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 boundedLiveRenderText tail-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 → 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.

    Env: macOS 26.5.1 (Apple Silicon) · Hermes Desktop v0.15.1

  5. szzhoujiarui-sketch commented on Jun 17, 2026

    @szzhoujiarui-sketch

    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.

  6. mxcrowe commented on Jul 11, 2026

    @mxcrowe

    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

    1. Use a model that emits assistant text before calling a tool (MiniMax M3 does this on nearly every tool-using turn).
    2. 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").
    3. 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 displayed
    SELECT 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.
  7. erict16 commented on Jul 22, 2026

    @erict16

    Opened a fix PR: #69202

    Root cause (Desktop live path): mergeFinalAssistantText replaced all text 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.

  8. added
    comp/desktopElectron desktop app (apps/desktop/*)
    P3Low — cosmetic, nice to have
    and removed
    comp/gatewayGateway runner, session dispatch, delivery
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    P2Medium — degraded but workaround exists
    on Jul 22, 2026
  9. GottZ commented on Jul 27, 2026

    @GottZ

    This was generated by AI during triage.

    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

    • fix(desktop): preserve pre-tool assistant text on turn complete #69202 best 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.

  10. added
    P2Medium — degraded but workaround exists
    and removed
    P3Low — cosmetic, nice to have
    on Jul 27, 2026
  11. PhanAnh-V commented on Aug 16, 2026

    @PhanAnh-V

    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:

    1. A tool-using turn streams assistant commentary and tool cards normally.
    2. The assistant text is visible briefly.
    3. During/after turn settlement, the text disappears while the tool card / Thought rows remain.
    4. 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.
    5. 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:

    const parts = [
      { 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.' }
    ]
    
    const settled = 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.' ]
    

    The existing focused suites pass (82/82):

    src/lib/chat-messages.test.ts
    src/app/session/hooks/use-message-stream/interim-sealing.test.tsx
    

    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.

  12. OutThisLife commented on Sep 23, 2026

    @OutThisLife

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/desktopElectron desktop app (apps/desktop/*)type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions