Skip to content

VS Code extension: lost characters (1-4 char chunks) in assistant's final message rendering #4139

Open

Description

@altanez

One-line summary: The assistant's final rendered message in the VS Code extension randomly loses 1–4 character chunks mid-word. The CLI-side session log (wire.jsonl) contains the fully intact text, so the loss happens after the CLI persisted the stream — in the CLI→extension transport or in the extension's webview rendering.

Environment

Component Version
Kimi Code CLI 0.24.1
VS Code extension moonshot-ai.kimi-code 0.8.1 (win32-x64)
VS Code 1.140.0 (x64)
OS Microsoft Windows 10.0.26200.9457 (Windows 11)
Session ID session_6f4a35f6-d6a1-469e-8ae8-827c04c03fdc

Reproduces on multiple PCs (at least two different Windows machines), so it is unlikely to be environment-specific.

Symptom

In the final (completed) assistant message — not during streaming, not in transient intermediate notes — random 1–4 character chunks are missing mid-word. Observed in Russian text with Markdown formatting; may well affect any language.

Examples from a single final message (what the CLI emitted vs what the extension displayed):

# Sent by CLI (intact, per wire.jsonl) Displayed in VS Code extension Lost
1 «кадры `tTrRdDbB`» «кры tTrRdDbB» «кад» + backticks
2 «двухсимвольная команда** б**итрейта» «двухсимвольная командаитрейта» « б»
3 «варианты реализации** (**опция» «варианты реализацииопция» « (»
4 «всегда CANable» «вегда CANable» «с»
5 «стоит сделать вам» «стоит сать вам» «дела»

Notes:

  • The corruption is stable after the message completes — it is not a transient streaming artifact; the finished message stays corrupted on screen.
  • Tool calls and file contents written by the agent are not affected (expected — they travel as structured events, not as the text stream).
  • Frequency: in recent days this appears in most long answers, on different PCs.

Evidence: CLI-side log contains the intact text

Full session log (wire.jsonl, ~1 MB): https://gist.github.com/altanez/8a6b00e1a1c4be21b185857a9a1dabde

Line 465 — streaming event as recorded by the CLI:

{"type":"context.append_loop_event","agentId":"main","event":{"type":"content.part","uuid":"72b4f434-c831-4432-a526-395259550931","turnId":"2","step":24,"stepUuid":"a7da31f3-6057-4077-8b37-a69616118bb4","part":{"type":"text","text":"Готово, сборка успешна (Flash 47924 байт / 9...

Excerpt from that same event (verbatim, intact):

…переключение `S`/`G` и сеанс cangaroo не могу, это стоит сделать вам (сценарий проверки ес…
…команды `O C S Y M A V E F W Q`, кадры `tTrRdDbB`, hex-данные только `0-9A-F`…

Line 524 — the persisted assistant message (also intact):

{"message":{"message":{"role":"assistant","content":[{"type":"think","think":"Build succeeded: 47924 bytes (9%) Flash, 6200 bytes RAM. ...

Line 573 — the user's next message, quoting what was actually visible on screen (corrupted):

…это стоит сать вам (сценарий проверки ес…

Conclusion from the evidence

The corruption exists in the text as displayed by the extension but not in the text as emitted and persisted by the CLI. Therefore characters are lost somewhere between the CLI session log and the extension webview — either in the CLI→extension message transport (dropped/misapplied stream deltas) or in the webview's incremental Markdown rendering (a race when applying text deltas).

Expected vs actual

  • Expected: The final rendered message is byte-identical to the text emitted by the CLI.
  • Actual: 1–4 character chunks are missing at random positions; occasionally inline-code backticks are dropped too.

Steps to reproduce

No deterministic repro known. It occurs frequently (most long answers in the last few days) in sessions with:

  • long final messages (several hundred words),
  • Russian (Cyrillic) text,
  • heavy Markdown use (inline code spans, bullet lists, tables),
  • many tool calls preceding the final message.

Report prepared with assistance from the Kimi Code agent itself: the intact-vs-corrupted comparison was produced by grepping the session's own wire.jsonl against the text visible in the extension UI.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions