Skip to content

refactor(agent-manager): extract project-scoped diff/review routing - #13538

Merged
marius-kilocode merged 1 commit into
mainfrom
refactor-agent-manager-review-routing
Aug 28, 2026
Merged

refactor(agent-manager): extract project-scoped diff/review routing#13538
marius-kilocode merged 1 commit into
mainfrom
refactor-agent-manager-review-routing

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Seven Agent Manager diff/review response routes repeat the same project guard inside the main subscription. This makes the applied-project boundary harder to test in isolation.

Why This Change Was Made

Extract only these routes into a small typed, runtime-independent helper that uses the existing isCurrent check and handlers. Keep currentProjectId (the project whose state has been applied), not activeProjectId, as the routing boundary. Preserve the subscription, dispatch position, stale-message early return, and accepted/unrelated-message fall-through.

User Impact

No intended behavior change. Legacy unqualified messages remain accepted. State ownership, session selection, rendering, and protocols are unchanged.

Evidence

  • 11 focused helper tests cover all seven routes, project-switch timing, identical worktree IDs across projects, unrelated messages, legacy messages, and the existing selection/review helpers. The related targeted run passed 204 tests across 12 files.
  • Passed from packages/kilo-vscode: bun test tests/unit/agent-manager-review-routing.test.ts, bun run lint, bun run typecheck, bun run knip, bun run check-kilocode-change, and bun run compile.
  • Passed from the repository root: bun run script/check-opencode-annotations.ts --worktree and git diff --check.
  • Isolated VS Code smoke test: opened inline diff and full-screen review, switched between local and worktree changes with multi-project disabled, then switched between two disposable projects and reopened each review. Content matched the selected source and loading settled. An injected stale branch response from the other project did not change the current review. Screenshots were inspected and the isolated instance was cleaned up. No model requests or apply/revert operations were performed.
Isolated smoke-test screenshots

Multi-project disabled, worktree review:

Legacy Agent Manager review showing the selected Alpha worktree change

Two projects, selected Beta project review:

Two-project Agent Manager review showing Beta content after switching projects

@kilo-code-bot

kilo-code-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • packages/kilo-vscode/webview-ui/agent-manager/project/review-routing.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/tests/unit/agent-manager-review-routing.test.ts

Reviewed by grok-4.6 · Input: 72.2K · Output: 11.3K · Cached: 677.8K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 21264ec into main Aug 28, 2026
23 checks passed
@marius-kilocode
marius-kilocode deleted the refactor-agent-manager-review-routing branch August 28, 2026 10:41
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