MoonshotAI / MoonshotAI/kimi-code

ACP + Zed: prompt with multiple attached files fails with `Internal error: session prompt failed`

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

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?

Reproduced on Kimi Code CLI 0.25.*, 0.24.*, and 0.23.*. Current version is 0.25.0

Which open platform/subscription were you using?

Kimi Code (OAuth).

Which model were you using?

kimi-for-coding

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

When using Kimi Code CLI as an ACP agent in Zed, sending a prompt with multiple attached files fails with the JSON-RPC error:

{
  "code": -32603,
  "message": "Internal error: session prompt failed"
}

Single-file or text-only prompts work fine.

What steps can reproduce the bug?
  1. Configure Zed to use kimi acp as the agent server.
// ~/.config/zed/settings.json
{
  "agent_servers": {
    "Kimi Code CLI": {
      "default_config_options": {
        "mode": "yolo"
      },
      "type": "custom",
      "command": "kimi",
      "args": ["acp"],
      "env": {}
    }
  }
}
  1. Open a new agent thread in Zed.
  2. Attach two or more files to the prompt via drag-and-drop or @-mention.
  3. (Optional) Add any user text and submit.

Zed sends ACP content blocks similar to:

[
  { "type": "resource", "resource": { "uri": "file:///.../a.tsx", "text": "..." } },
  { "type": "text", "text": " " },
  { "type": "resource", "resource": { "uri": "file:///.../b.tsx", "text": "..." } },
  { "type": "text", "text": " " },
  { "type": "text", "text": "todo: ..." }
]
What is the expected behavior?

The prompt should be accepted and the turn should start, preserving the whitespace separators inside the merged text rather than as standalone text parts.

Additional information

Affected editor versions: Zed 1.10.*, 1.11.*, and 1.12.0.

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

Start at the kimi acp agent-server entry point and trace how Zed's ACP content-block array becomes a session prompt. Reproduce the failure with two resource blocks and intervening whitespace, then verify that multiple attached files are accepted and the separators remain in the merged text.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.