MoonshotAI / MoonshotAI/kimi-code
Edits break when the edit contains multiple backslashes
Open
Nobody has claimed this yet.
bug
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure by editing src/game/lessons.rs with text containing multiple backslashes, using the Edit tool. Trace the Edit handling for escaped text and compare the submitted old_string with the file contents. Done means edits containing multiple backslashes apply successfully without the old_string-not-found error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100