MoonshotAI / MoonshotAI/kimi-code
[Bug] 长会话多轮 compact 后工具调用静默退化为空 Bash(TodoList/Edit/Agent/CronCreate 不执行但返回成功)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
现象
在一个长时间运行的会话中(经历多轮 context compaction),模型发出的工具调用被静默替换为空 Bash 调用(如 true):工具返回成功,但实际什么都没执行。
受影响工具(按出现顺序):Agent、CronCreate(compact 前约 17 次同类),compact 后 TodoList ×4、Edit ×6。
危险点
静默空操作——Agent 认为文件已写入/todo 已记录/子代理已派出,实际什么都没发生。对无人值守的长会话(我们用它做 7×24 的 FC 协调席)是高危故障。
环境
- kimi-code 0.41.0
- macOS arm64(Mac Studio)
- 通过 Orca 终端运行(
kimi --auto,K3 模型)
关键特征:会话级
同一台机器、同一版本的其他会话完全正常。故障会话内部确认:只有这一个会话出现工具调用退化。compact 前的会话段已发生约 17 次,compact 后的新会话段仍继续发生(TodoList×4、Edit×6),说明 compact 不能修复。
Workaround
会话内改用 Bash + python 直写文件可完成功能(内容锚点断言后写入)。功能不丢,但所有写操作都失去原生工具路径。
复现线索
无法给出确定性复现步骤。已知相关条件:长会话 + 多轮 compaction + 高频工具调用。session export(kimi export,含 global log)已备好,可应要求发到 code@moonshot.ai 或按指引上传。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the prepared session export from kimi export, including the global log, and compare tool calls before and after context compaction. Trace where Agent, CronCreate, TodoList, and Edit become Bash with true; done means affected tools execute normally or fail visibly instead of returning false success.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100