Skip to content

fix(agent-manager): batch worktree diff details - #13449

Merged
marius-kilocode merged 2 commits into
mainfrom
perf/agent-manager-bulk-diff-details
Aug 26, 2026
Merged

fix(agent-manager): batch worktree diff details#13449
marius-kilocode merged 2 commits into
mainfrom
perf/agent-manager-bulk-diff-details

Conversation

@marius-kilocode

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

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Opening an Agent Manager worktree review starts separate Git size, content, and patch commands for each changed file. On a 12-file review with 10 tracked files, that means about 30 Git subprocesses, unnecessary disk contention, and a visible delay before every expanded diff is ready.

Why This Change Was Made

Use size-checked git cat-file --batch-check, binary-safe git cat-file --batch, and one path-scoped combined git diff to materialize eligible text files together. Keep complete file contents and hunk-bounded patches, preserve project ownership and source cancellation, and explicitly defer files that exceed the aggregate memory budget to the existing single-file path. Images, binary files, unsupported paths, failed batches, and non-bulk sources continue to use their existing behavior.

User Impact

Metric Before After Improvement
Git subprocesses for 10 tracked files 30 3 90% fewer
Complete 12-file review 480 ms 290 ms 40% faster
12-file diff detail phase 200 ms 48 ms 76% faster
12-file Git detail generation 165 ms 39 ms 76% faster
17-file Git detail generation 164 ms 43 ms 74% faster

Cached worktree switching, full-screen review, scrolling, images, and complete expanded diffs remain available.

Evidence

  • bun run test:unit: 4,210 passing tests on the rebased branch.
  • bun run build:check, bun run knip, and bun run check-kilocode-change pass.
  • Real isolated VS Code self-tests covered 12-file and 17-file reviews, rapid worktree switching, full-screen review, untracked files, and scrolling.
  • Regression tests cover aggregate memory limits, explicit deferred fallback, binary and image content, project isolation, cancellation, stale summary snapshots, unchanged refreshes, nested paths, patch boundaries, and failed batch recovery.
  • Interactive profiling was performed on macOS. Repository CI runs extension unit tests on Linux; Windows was not directly exercised.

Closes #13415

Comment thread packages/kilo-vscode/src/agent-manager/local-diff.ts
Comment thread packages/kilo-vscode/src/agent-manager/local-diff.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/kilo-vscode/src/agent-manager/local-diff.ts
  • packages/kilo-vscode/tests/unit/local-diff.test.ts
Previous Review Summary (commit 44395d3)

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

Previous review (commit 44395d3)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-vscode/src/agent-manager/local-diff.ts 476 Bulk Git failures become null details with no single-file fallback
packages/kilo-vscode/src/agent-manager/local-diff.ts 514 Unchanged summary polls invalidate in-flight batches by object identity
Files Reviewed (27 files)
  • .changeset/bulk-agent-manager-diff-details.md - 0 issues
  • packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts - 0 issues
  • packages/kilo-vscode/src/agent-manager/GitOps.ts - 0 issues
  • packages/kilo-vscode/src/agent-manager/local-diff-batch.ts - 0 issues
  • packages/kilo-vscode/src/agent-manager/local-diff.ts - 2 issues
  • packages/kilo-vscode/src/agent-manager/types.ts - 0 issues
  • packages/kilo-vscode/src/agent-manager/worktree-diff-controller.ts - 0 issues
  • packages/kilo-vscode/src/diff/SourceController.ts - 0 issues
  • packages/kilo-vscode/src/diff/sources/catalog.ts - 0 issues
  • packages/kilo-vscode/src/diff/sources/types.ts - 0 issues
  • packages/kilo-vscode/src/diff/sources/worktree.ts - 0 issues
  • packages/kilo-vscode/src/diff/types.ts - 0 issues
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/agent-manager-worktree-diffs.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/diff-preview-request.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/diff-source-catalog.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/git-ops.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/local-diff.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/source-controller.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/worktree-diff-controller.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/DiffPanelCache.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/worktree-diffs.ts - 0 issues
  • packages/kilo-vscode/webview-ui/diff-viewer/FullScreenDiffView.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/diff-viewer/diff-requests.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 116.2K · Output: 11.4K · Cached: 322K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit f78d736 into main Aug 26, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the perf/agent-manager-bulk-diff-details branch August 26, 2026 08:30
Felixkw12 pushed a commit to Felixkw12/kilocode that referenced this pull request Aug 26, 2026
…nager-bulk-diff-details"

This reverts commit f78d736, reversing
changes made to 7834f93.
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.

[FEATURE]: Support bulk patch generation for Agent Manager worktree diffs

2 participants