Skip to content

fix(vscode): prevent Agent Manager overview timeouts - #12885

Merged
marius-kilocode merged 3 commits into
mainfrom
investigate-agent-manager-timeout
Aug 5, 2026
Merged

fix(vscode): prevent Agent Manager overview timeouts#12885
marius-kilocode merged 3 commits into
mainfrom
investigate-agent-manager-timeout

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Agent Manager overview requests currently force a Git statistics refresh before returning. With many managed worktrees, that refresh launches diff and ahead/behind operations for every worktree and can exceed the orchestration host timeout, leaving session-management tools unavailable.

The overview now uses the poller’s cached statistics while background polling continues to refresh them. This keeps worktree and session IDs available without coupling the orchestration response to repository-wide Git work, with regression coverage for a stalled refresh.

Comment thread packages/kilo-vscode/src/agent-manager/orchestration-bridge.ts
@kilo-code-bot

kilo-code-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • .changeset/quiet-worktrees-list.md
  • packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts
  • packages/kilo-vscode/src/agent-manager/GitStatsPoller.ts
  • packages/kilo-vscode/src/agent-manager/orchestration-bridge.ts
  • packages/kilo-vscode/tests/unit/agent-manager-orchestration-bridge.test.ts

The follow-up commits resolve the previously flagged dead-code concern: GitStatsPoller.snapshot() drops the unused refresh parameter and its forced-refresh branch, Options.stats and the AgentManagerProvider wiring are updated to match, and the now-callerless includeSkipped parameter is removed from fetchWorktreeStats. All call sites are consistent (verified snapshot() and stats() have no stale argument-passing callers), the busy flag remains correctly managed by poll()/stop(), and the test mock/assertions track the new no-arg signature. No memory-leak concerns — the change removes process-spawning and promise work and adds no new handles, timers, or subscriptions.

Previous Review Summary (commit 817c04b)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 817c04b)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/src/agent-manager/orchestration-bridge.ts 263 Dropping the forced refresh leaves GitStatsPoller.snapshot(refresh) with no production caller; consider removing the now-dead refresh branch or keeping it intentionally
Files Reviewed (3 files)
  • .changeset/quiet-worktrees-list.md - 0 issues
  • packages/kilo-vscode/src/agent-manager/orchestration-bridge.ts - 1 issue
  • packages/kilo-vscode/tests/unit/agent-manager-orchestration-bridge.test.ts - 0 issues

The fix itself is sound: the overview now reads the poller's cached stats (snapshot() default path) instead of forcing a per-worktree diff/ahead-behind refresh, and overview() treats stats as optional metadata so a cold cache degrades to omitted git fields rather than wrong data. The regression test correctly fails fast if a forced refresh is reintroduced, and the new permission.list/question.list mocks are required by the previously untested overview path. No memory-leak concerns — the change removes process-spawning work and adds no new handles, timers, or subscriptions.

Fix these issues in Kilo Cloud


Reviewed by kimi-k3 · Input: 48K · Output: 7.2K · Cached: 386.3K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit a82fa99 into main Aug 5, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the investigate-agent-manager-timeout branch August 5, 2026 09:22
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…ager-timeout

fix(vscode): prevent Agent Manager overview timeouts
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