Skip to content

Web UI: assistant messages re-render as one-fragment-per-line after tab switch/reload for non-Kimi (OpenAI-compatible) providers #2607

Description

@chenxupeng1990-eng

Describe the bug
In the web UI, assistant messages in sessions using a custom OpenAI-compatible provider render correctly while streaming, but after any remount (browser tab switch and back, page reload, or reopening the session) they re-render as one stream delta per line — a narrow vertical strip. The same session renders correctly with Kimi providers.

Version
Kimi Code CLI 0.36.1 (web UI), macOS. Also present on 0.29.1; persists after upgrading.

To Reproduce

  1. Configure a custom OpenAI-compatible provider (tested: Aliyun DashScope, model qwen3.8-max)
  2. Start a web UI session with that model and get a reply
  3. While streaming / right after: reply renders correctly (full-width markdown)
  4. Switch to another browser tab and back (or reload / reopen the session)
  5. The reply re-renders as one delta fragment per line in a narrow vertical column; stays broken forever after

Expected behavior
Streamed text deltas are coalesced into a single markdown message block on replay, exactly as with Kimi providers.

Actual behavior
Each streamed text part renders as an independent block/line on replay.

Evidence / root-cause hint

  • Session wire.jsonl stores the reply as many tiny text parts (some as short as 3 chars) for BOTH Kimi and custom providers — data is intact; concatenating the parts yields the full text.
  • The live streaming path coalesces deltas in memory for all providers; the replay path (tab-return remount, reload, history) re-renders from stored parts without coalescing for non-Kimi providers.
  • TUI/terminal rendering is unaffected.
  • Not fixed by page refresh or by upgrading 0.29.1 → 0.36.1.

Screenshots of both states (correct live render, broken replay) available on request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions