Skip to content

fix(agent-manager): show background worktree activity - #13502

Merged
marius-kilocode merged 3 commits into
mainfrom
show-worktree-running-state
Aug 27, 2026
Merged

fix(agent-manager): show background worktree activity#13502
marius-kilocode merged 3 commits into
mainfrom
show-worktree-running-state

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Agent Manager can show a worktree as idle after its main agent finishes, even while a background agent still works in that directory. Looking only at managed parent sessions also misses running children after the webview reloads.

Why This Change Was Made

Track worktree activity separately from the selected transcript and the root-session inventory. Read directory-scoped session statuses and pending prompts when worktrees are first loaded or the view reconnects, then keep the cache current with existing SSE events. This avoids loading child histories or adding a background-job polling loop.

User Impact

  • Keep the worktree spinner while any session in its directory is busy or retrying, including background and nested agents.
  • Keep activity visible when another worktree is selected and after a webview reload.
  • Do not count sessions that are offline, waiting for permission, or waiting for a blocking question. Other running sessions can still keep the worktree active.
  • Leave the parent session's actual status and prompt controls unchanged.

Evidence

  • Passed extension typecheck, lint, build, Knip, Kilo-owned code guard, and all 4,256 unit tests.
  • Added regression coverage for snapshot/event ordering, failed-read recovery, partial loads, cancellation, deletion, offline state, pending prompts, and directory isolation.
  • Exercised real CLI background tasks in isolated VS Code with a deterministic local model fixture. Confirmed the idle parent's worktree keeps spinning, Local stays idle, switching and webview reload preserve activity, and completion or cancellation clears the spinner. Confirmed a pending permission stops the spinner with its prompt visible in the child inspector.
  • Rebuilt and repeated the inactive-worktree reload and completion flow after the recovery fix. No real credentials or existing worktrees were used for these tests.

Main agent finished, background agent still running:

Worktree spinner remains active after the main agent finishes while one background agent runs

After selecting Local and reloading the webview:

Inactive worktree retains its spinner after webview reload while Local remains idle

@kilo-code-bot

This comment has been minimized.

Comment thread packages/kilo-vscode/src/agent-manager/worktree-activity.ts Outdated
Comment thread packages/kilo-vscode/src/agent-manager/worktree-activity.ts Outdated
@marius-kilocode
marius-kilocode merged commit 15c3db7 into main Aug 27, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the show-worktree-running-state branch August 27, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants