kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

Markdown code fences are prematurely closed in long handoff responses

Open wangzhefeng opened this issue 2 weeks ago • 0 comments

Summary

When asked to generate a long handoff prompt containing multiple shell snippets, the assistant wrapped the whole response in a text fence and then used a bash fence inside it. Because both fences used three backticks, the inner fence prematurely closed the outer block. The remaining response was rendered outside the intended code region, making the handoff difficult to read and copy.

Steps to reproduce

  1. Ask for a long task handoff prompt containing multiple Bash commands.
  2. Observe that the response starts with a three-backtick text fence and later contains a three-backtick bash fence.
  3. The inner fence closes the outer block, so subsequent text is no longer part of the same copyable prompt.
  4. Long commands and paths also produce horizontal scrolling, further obscuring the content.

Expected behavior

  • Long responses should use valid, copyable Markdown.
  • If nested fences are needed, the outer fence should use four backticks and inner fences three backticks, or the response should avoid nesting altogether.
  • Long commands should be split into small, separate code blocks to reduce horizontal scrolling.

Actual behavior

The same three-backtick delimiter is used at both levels, so the inner delimiter terminates the outer block and the handoff loses its intended single-block structure.

Environment

  • Kimi Code version: 0.28.1
  • Platform: macOS

This report intentionally contains no project-specific content, logs, codebases, session exports, or screenshots.

wangzhefeng avatar Nov 12 '26 03:11 wangzhefeng