MoonshotAI / MoonshotAI/kimi-code

中断恢复后模型接错话题(回合无收尾 + turnId 重置 + TodoList 主子共享残留)

Open
#3,385 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

中断恢复后模型接错话题(上下文抓错)+ turnId 重置 + TodoList 残留

环境:Kimi Code CLI 0.36.0,Windows 11,模型 kimi-code/k3

现象

长会话中一次子代理调用被 403(5 小时额度上限)打断,该轮没有产出任何面向用户的总结就结束了。用户随后问了一句"做完了还是?"(指当前任务),模型却把它接到了压缩保留下来的两天前旧话题上,答非所问。

wire.jsonl 证据(session_bc28eb7c-d1a4-4f50-ba8f-68c9966d300a):

  • 行 14142:turn 210 step 31,Agent 工具调用(子代理,随后 403)
  • 行 14145:用户新输入"做完了还是?"
  • 行 14149-14153:回复被标记为 turnId 25(前一事件是 turnId 210——turnId 在压缩/恢复后重置,交错出现)
  • 行 14152 模型的 think 自认在"猜"用户问的是旧话题
  • 行 14137 vs 14148:两条 TodoList reminder 内容来自不同时代(旧窗口残留 todo 与当前 todo 并存)——子代理的 TodoList 与主 agent 共享 store,子代理中断后留下脏状态
三个可拆的问题
  1. 任务异常中断(如额度 403)后回合无收尾——没有提示用户"中断了",下一条输入进来时模型要自己猜断点在哪
  2. turnId 在压缩/恢复后重置,wire 里出现 210 → 25 的交错,给排查制造混乱
  3. TodoList store 在主子代理间共享,子代理中断后其 todo 残留进主上下文的 reminder
建议
  • 子代理/工具异常终止时给用户一个明确的"回合中断"收尾消息
  • turnId 保持全局单调(或压缩后带前缀区分时代)
  • TodoList 按 agent 隔离,或子代理退出时恢复主 agent 的 todo 快照

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 with the supplied wire.jsonl evidence for session_bc28eb7c-d1a4-4f50-ba8f-68c9966d300a, especially lines 14142-14153 and the TodoList reminders at lines 14137 and 14148. Trace interruption recovery, turnId assignment after compression, and TodoList ownership between the main agent and sub-agent. Done means interrupted turns are explicitly closed, turn IDs remain distinguishable, and sub-agent todo state does not leak into the main context.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.