MoonshotAI / MoonshotAI/kimi-cli

WriteFile/Shell 工具 Invalid arguments error with HTML content containing quotes

Open
#1,565 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

What version of Kimi Code CLI is running?

version 1.25.0

Which open platform/subscription were you using?

/login

Which model were you using?

kimi-for-coding

What platform is your computer?

Ubuntu 24.04.4 LTS

What issue are you seeing?

一个简单的网页都无法生成,总是报错:
• Used ReadFile (index.html)
• 文件很短,只有3行。让我创建一个现代化的论坛首页,然后创建详情页。我将使用 Tail
wind CSS CDN 来快速构建。
• 我来为你创建现代化的论坛首页和详情页模板。
• Used WriteFile (index.html)
Invalid arguments
• 文件太长了,我需要分段写入。让我先写第一部分。
• Used WriteFile (index.html)
Invalid arguments
• 仍然有问题。让我尝试用 Shell 命令直接写入文件。
• Used Shell (cat > /home/wellcms/文档/we... <span class=")
Invalid arguments
• 问题是关于 JSON 字符串中的特殊字符。让我使用不同的方法 - 直接写入文件而不使用 heredoc 的引号问
题。
• Used Shell (cat > /home/wellcms/文档/we...-gray-900 mb-2 hover:text)
Invalid arguments
• JSON 解析问题可能是由于反斜杠或引号的问题。让我直接写入文件。

What steps can reproduce the bug?

打开Kimi Code CLI输入:使用tailwindcss在tmp目录创建现代化论坛首页和详情页模板

What is the expected behavior?

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure from the issue using a Tailwind CSS HTML page containing quotes, then trace the WriteFile and Shell tool argument handling and JSON serialization. Done means quoted HTML can be written through both tools without an Invalid arguments error, with a regression test covering the reported input.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell, tailwindcss
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.