MoonshotAI / MoonshotAI/kimi-cli

k2.5 模型 tool calling 完全失效 + goal mode 无限循环(必现) || k2.5 model tool calling completely invalid + goal mode infinite loop (must appear)

Open
#2,527 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

问题描述

使用 k2.5 模型时,tool calling 完全无法执行,且在 goal mode 下会陷入无限循环无法退出。

复现步骤

  1. 使用 k2.5 模型
  2. 设置一个 goal(如:列出我~/.claude所有的memory和skill,并总结
  3. 模型尝试调用 Bash 工具

实际行为

  • 模型生成 tool call,但执行层返回 "Tool not found"
  • 尝试所有格式(functions_Bashfunctions_Bash_0<functions_Bash_0>、JSON 格式)全部失败
  • Goal mode 持续推进轮次,但没有任何实际工作完成
  • 模型无法调用 UpdateGoal 标记 blocked,也无法自行退出
  • 最终陷入 29+ 轮的死循环,直到用户手动 Ctrl+C

模型输出片段

✗ Used functions_Bash (find ~/.claude -type f -name "*.md" 2>/dev/null | head -50)
  Tool "functions_Bash" not found

✗ Used functions_UpdateGoal (blocked)
  Tool "functions_UpdateGoal" not found

模型随后尝试了各种格式变体,全部返回 "Tool not found",循环 29 轮无法退出。

环境

  • 模型:k2.5
  • 模式:goal mode
  • 问题:100% 必现

分析

这不是配置问题,是模型输出的 tool call 格式与 CLI 执行层之间的 mismatch。模型生成了调用意图,但 dispatcher 没有正确匹配到实际的工具函数。

相关 issues:

  • #1105 (Kimi got crazy, in a loop and wasted all the usage)
  • #640 (stuck in reading one file again and again)
  • MoonshotAI/Kimi-K2.5#24 (Infinite tool-call loop)

这个问题导致 k2.5 在 tool calling 场景下完全不可用,严重程度为 P0。


Problem description

When using the k2.5 model, tool calling cannot be executed at all, and will fall into an infinite loop in goal mode and cannot exit.

Reproduction steps

  1. Use k2.5 model
  2. Set a goal (for example: List all the memories and skills in my ~/.claude and summarize)
  3. The model tries to call the Bash tool

Actual behavior

  • The model generates a tool call, but the execution layer returns "Tool not found"
  • Tried all formats (functions_Bash, functions_Bash_0, <functions_Bash_0>, JSON format) all failed
  • Goal mode continues to advance rounds without any actual work being completed
  • The model cannot call UpdateGoal flag blocked and cannot exit by itself
  • Eventually fell into an infinite loop of 29+ rounds until the user manually Ctrl+C

Model output fragment

✗ Used functions_Bash (find ~/.claude -type f -name "*.md" 2>/dev/null | head -50)
  Tool "functions_Bash" not found

✗ Used functions_UpdateGoal (blocked)
  Tool "functions_UpdateGoal" not found

The model then tried various format variations, all of which returned "Tool not found" and could not exit the loop for 29 rounds.

Environment

  • Model: k2.5
    -Mode: goal mode
  • Question: 100% sure to appear

Analysis

This is not a configuration issue, but a mismatch between the tool call format of the model output and the CLI execution layer. The model generated the calling intent, but the dispatcher did not correctly match the actual utility function.

Related issues:

  • #1105 (Kimi got crazy, in a loop and wasted all the usage)
  • #640 (stuck in reading one file again and again)
  • MoonshotAI/Kimi-K2.5#24 (Infinite tool-call loop)

This issue renders k2.5 completely unusable in tool calling scenarios with severity P0.

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 tracing the CLI's tool-call dispatcher and execution layer, then follow the goal mode loop using the k2.5 reproduction described here. Check how Bash and UpdateGoal call formats are matched and how failed calls affect loop termination. Done means valid tool calls execute and an unhandled call cannot keep goal mode running indefinitely.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.