MoonshotAI / MoonshotAI/kimi-cli

使用kimi-cli连接vllm本地模型,执行/compact命令(或自动触发)时,可能会发送一个空的tools数组 || Use kimi-cli to connect to the vllm local model. When executing the /compact command (or automatically triggering it), an empty tools array may be sent.

Open
#2,233 0 comments 1 reaction 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.42

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

No response

What platform is your computer?

No response

What issue are you seeing?

kimi-cli可能会发送一个空的tools数组,在某些环境,这是不被允许的。
例如vllm,接收到空的tools数组时,会触发一个400错误。
"Value error, 'tools' must not be an empty array. Either provide at least one tool or omit the field entirely."

What steps can reproduce the bug?
  1. 使用kimi-cli选择provider type:"openai_legacy"的模型。(vllm本地模型)
  2. 执行/compact命令(或自动触发)
  3. kimi-cli一定概率会发送一个空的tools数组,导致vllm报错拒绝。
What is the expected behavior?
  1. 当tools为空时,它不应该被发送(或发送omit)
  2. /compact不涉及工具调用,永远不应该有tools
Additional information

No response


What version of Kimi Code CLI is running?

1.42

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

No response

What platform is your computer?

No response

What issue are you seeing?

kimi-cli may send an empty tools array, which is not allowed in some environments.
For example, vllm will trigger a 400 error when receiving an empty tools array.
"Value error, 'tools' must not be an empty array. Either provide at least one tool or omit the field entirely."

What steps can reproduce the bug?
  1. Use kimi-cli to select the model with provider type: "openai_legacy". (vllm local model)
  2. Execute /compact command (or automatically trigger)
  3. There is a certain probability that kimi-cli will send an empty tools array, causing vllm to report an error and reject it.
What is the expected behavior?
  1. When tools is empty, it should not be sent (or send omit)
  2. /compact does not involve tool calls and should never have tools
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 issue through the /compact command with an openai_legacy provider against a vllm-compatible endpoint, then trace the request path where tools is serialized. Verify that empty tools data is omitted and that /compact requests never include tools, using the reported 400 response as the failure criterion.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.