MoonshotAI / MoonshotAI/kimi-cli

Bug: ToolResult 返回后触发 JSON 序列化错误 `invalid type: sequence, expected

Open
#1,762 2 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?

1.30.0

Which open platform/subscription were you using?

Which model were you using?

No response

What platform is your computer?

linux

What issue are you seeing?

错误日志:

{"jsonrpc":"2.0","id":"...","error":{"code":-32003,"message":"Error code: 400 - {'error': {'message': 'Failed to deserialize the JSON body into the target type: messages[3]: invalid type: sequence, expected a string at line 1 column 15510'...

### What steps can reproduce the bug?

**复现步骤**:
1. 创建 Session
2. 通过 WebSocket 发送 prompt: "看下币安的eth/usdt合约,目前是震荡,还是上升,下降?"
3. Kimi 调用 Shell 工具: `{"command": "which curl && which python3"}`
4. 工具返回成功: `{"is_error": false, "output": "/usr/bin/curl\n/root/.local/bin/python3\n", "display": []}`
5. 服务端报错,WS 返回: `Error code: 400 - Failed to deserialize the JSON body...`

### What is the expected behavior?

服务端应正确处理 ToolResult,继续下一轮对话,而不是返回 400 错误。

### 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

Start by reproducing the Session and WebSocket flow described in the issue, including the successful Shell ToolResult, then trace where that result is serialized for the next model request. Done means the ToolResult is accepted and the conversation continues without a 400 deserialization error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.