MoonshotAI / MoonshotAI/kimi-code

bug: 因后台任务上限被拒绝启动的子 Agent 在任务面板显示为永久「运行中」且无法停止

Open
#2,673 1 comment 1 reaction 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

What version of Kimi Code is running?

0.33.0

Which open platform/subscription were you using?

kimi code

Which model were you using?

与模型无关(任务面板状态同步问题)

What platform is your computer?

Windows 11 x64

What issue are you seeing?

后台任务上限被拒绝启动的子 Agent,会在任务面板中显示为永久「运行中」的幽灵条目,且无法停止。

具体经过:一个回合内并行启动 4 个后台子 Agent,其中 2 个因达到后台任务上限被服务器拒绝(工具返回 Too many background tasks are already running,服务端从未实际创建 agent-1 / agent-2)。但客户端任务面板仍把这两个被拒绝的启动登记为「运行中」,运行时长一直增长(截图时已超过 57 分钟)。

之后同名的新子 Agent 正常启动并完成,面板上同名任务出现两次:一条「完成」,一条永远「运行中」。

点击 stop 无法停止,服务器返回错误:

  • task agent-1 does not exist in session session_b38cb9b8-9de2-4a69-a16a-0c42a4a72a1d
  • task agent-2 does not exist in session session_b38cb9b8-9de2-4a69-a16a-0c42a4a72a1d

会话内 TaskList 接口返回 0 个活动任务(所有真实任务均已正常完成),即面板显示与服务端真实状态不一致,且不会自愈。

What steps can reproduce the bug?
  1. 在一个回合内启动多个后台子 Agent(例如 4 个),使其中部分因 Too many background tasks are already running 被拒绝;
  2. 等待其它任务完成后,再启动新的同名子 Agent 并让其正常完成;
  3. 打开任务面板:被拒绝的条目显示为「运行中」且时长持续增长,与已完成条目同名并存;
  4. 点击该条目的 stop → 服务器返回 task agent-N does not exist in session ...,条目无法移除。
What is the expected behavior?
  • 被拒绝(未实际创建)的子 Agent 不应登记进任务面板;或
  • 面板应与服务端状态对账,自动清理不存在的任务条目;
  • 至少对不存在的任务执行 stop 时应移除该条目,而不是报错后依旧残留。
Additional information

截图可补充:任务面板中同名子 Agent 一条「完成 · 659s」、一条「运行中 · 57:04」并存;stop 时报错 toast「Kimi 服务器返回错误 task agent-1 does not exist in session ...」。

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

Trace the task-panel registration path for background agents and the handling of the server response Too many background tasks are already running; then inspect stop handling for the task ... does not exist error. Compare client entries with the session TaskList result. Done means rejected agents are not retained, or missing tasks are reconciled and removed, including after stop fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.