Skip to content

Edits break when the edit contains multiple backslashes #601

@siennathesane

Description

@siennathesane

What version of Kimi Code is running?

Kimi Code v0.12.1

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

kimi-for-coding

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

Edits are failing when there are multiple backslashes:

 ✗ Used Edit (src/game/lessons.rs) · +2 -4
   +2 -4 src/game/lessons.rs
      1 -              the files on your actual computer.",\
      2 -              The computer reads it, does the work, and types back a response.",
      3 -         syntax: "command [options] [arguments]",","new_string":"             the files on your actual computer.",
      4 -         syntax: "command [options] [arguments]",",
      1 +              the files on your actual computer.",
      2 +         syntax: "command [options] [arguments]",
   old_string not found in src/game/lessons.rs, the file contents may be out of date. Please use the Read Tool to reload the content.
 ✗ Used Edit (src/game/lessons.rs) · +1 -4
   +1 -4 src/game/lessons.rs
      1           analogy: "The terminal is like a text-message conversation with the computer.",
      2 -         explanation: "You type a command after the `$` prompt and press Enter. \
      3 -              The computer reads it, does the work, and types back a response.",
      4 -         syntax: "command [options] [arguments]",","new_string":"        analogy: "The terminal is like a text-message conversation with the computer.",
      2           explanation: "You type a command after the `$` prompt and press Enter. \
      3                The computer reads it, does the work, and types back a response. \
      4                This terminal behaves like a real shell on a computer, but it is safely \
      5                sandboxed inside your browser — nothing you type here can change \
      6                the files on your actual computer.",
     10 -         syntax: "command [options] [arguments]",",
        … 1 more change hidden (ctrl+o to expand)
   old_string not found in src/game/lessons.rs, the file contents may be out of date. Please use the Read Tool to reload the content.
 ✗ Used Edit (src/game/lessons.rs) · +4 -1
   +4 -1 src/game/lessons.rs
      1           analogy: "The terminal is like a text-message conversation with the computer.",
      2           explanation: "You type a command after the `$` prompt and press Enter. \
      3 -              The computer reads it, does the work, and types back a response.",
      3 +              The computer reads it, does the work, and types back a response. \
      4 +              This terminal behaves like a real shell on a computer, but it is safely \
      5 +              sandboxed inside your browser — nothing you type here can change \
      6 +              the files on your actual computer.",
      7           syntax: "command [options] [arguments]",",
   old_string not found in src/game/lessons.rs, the file contents may be out of date. Please use the Read Tool to reload the content.

What steps can reproduce the bug?

Any edit with multiple backslashes should be reproducable.

What is the expected behavior?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions