MoonshotAI / MoonshotAI/kimi-code

[TUI] Subagent panel keeps completed foreground subagents listed as running indefinitely (elapsed timer never stops; negative-time glitch on completed entries)

Open
#2,154 4 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

Summary

In the TUI side panel ("子 Agent · N 运行中"), subagents that ran in the foreground (parallel Agent tool calls whose results have already been returned to and consumed by the parent) remain listed as 运行中 (running) with an ever-increasing elapsed timer, hours after completion. The task system reports zero active background tasks, and no child processes remain.

Environment

  • kimi-code 0.29.0
  • Windows 11, Git Bash

Observed behavior

  1. Launch ≥2 foreground parallel subagents (e.g. read-only explore agents).
  2. All of them complete; the parent receives and uses their reports (files written from their output, work continues for hours).
  3. The panel still shows them as 运行中 with the timer counting up from launch time (e.g. 运行中 · 351:31 — 5.8 hours after completion).
  4. Entries accumulate: resuming a foreground subagent adds another permanently-stuck entry (in one session the stuck count grew from 3 to 4).
  5. A background subagent (run_in_background=true) in the same session did flip to 完成 — but its elapsed field first rendered a negative value (完成 · -1993s) and later showed a positive one (完成 · 1070s), i.e. the sign/format of the "time since completion" field is also unstable.

Expected

  • Panel entries transition to a completed state when the subagent finishes (regardless of foreground/background), and the timer stops.
  • Elapsed-since-completion never renders negative.

Evidence

  • TaskList (active_only=false) at the same moment: active_background_tasks: 0.
  • The "running" agents' deliverables were produced hours earlier and subsequent task stages have long finished (screenshots available on request).

Impact

Cosmetic/state-tracking only — no functional damage — but genuinely misleading: users cannot distinguish live work from stale entries, and the counter grows without bound.

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 TUI side panel’s subagent entries and the TaskList state for foreground and background tasks. Reproduce parallel foreground agents and a background agent, then verify that completed entries stop showing as running and that elapsed-since-completion never renders a negative value.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.