Skip to content

feat(agent-manager): target new worktrees by project - #12931

Merged
marius-kilocode merged 7 commits into
mainfrom
configure-agent-manager-project-selection
Aug 6, 2026
Merged

feat(agent-manager): target new worktrees by project#12931
marius-kilocode merged 7 commits into
mainfrom
configure-agent-manager-project-selection

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

New Worktree creation in multi-project Agent Manager silently used the active repository when opened with Cmd+N. The dialog did not show the target repository, and users could only choose a different project through the per-project add button.

This adds an explicit project selector inline with the New and Import tabs. It defaults to the active project, lets users switch between existing registered projects, and disables untrusted or missing repositories so trust and registration remain managed from the Projects toolbar. Branch lists, imports, base-branch defaults, and creation requests now follow the selected project. Responses carry project IDs to prevent stale data from a previous selection from being applied. Creating in a different project activates the first resulting worktree.

New Worktree dialog with the existing project selector

Existing projects in the New Worktree project dropdown

Comment thread packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx
Comment thread packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
@kilo-code-bot

kilo-code-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1

Incremental review of 16689bb..585c4e4: the branch was rebased again (tip commit updates visual-regression baselines), but the resulting tree is byte-identical to the previously reviewed commit — the delta is empty, so there is no new code to review and nothing previously flagged was resolved. All existing inline comments remain anchored on the current HEAD. The one residual edge case from the previous review was re-verified against 585c4e4 and remains open.

Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 273 Provider-side silent drops still strand pendingCreate: messages for an unusable/unknown project and state-gate failures are dropped with only a log (no importResult/worktreeSetup is posted), so the slot stays stuck and blocks future cross-project schedules until webview reload
Files Reviewed (0 files changed in delta)
  • No files changed since the previous review (rebase with identical tree)

Fix these issues in Kilo Cloud

Previous Review Summaries (5 snapshots, latest commit 16689bb)

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

Previous review (commit 16689bb)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1

Incremental review of 0ba179e..16689bb: the branch was rebased onto current main, but the resulting tree is byte-identical to the previously reviewed commit — the delta is empty, so there is no new code to review and nothing previously flagged was resolved. All existing inline comments remain anchored on the current HEAD. The one residual edge case from the previous review remains open.

Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 273 Import-failure paths are now covered, but provider-side silent drops still strand pendingCreate: messages for an unusable/unknown project and state-gate failures are dropped with only a log (no importResult/worktreeSetup is posted), so the slot stays stuck and blocks future cross-project schedules until webview reload
Files Reviewed (0 files changed in delta)
  • No files changed since the previous review (rebase with identical tree)

Fix these issues in Kilo Cloud

Previous review (commit 0ba179e)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1

Incremental review of 726f181..0ba179e (2 files, +6 lines). The delta clears pendingCreate when an agentManager.importResult arrives with success: false and a matching project, and pins the behavior with test assertions. Verified: all three importer failure paths (Not a git repository, busy, importError) post a failing importResult carrying the originating projectId, so import failures no longer strand the slot; the success path still clears via worktreeSetup ready before the success importResult arrives, and the projectId equality guard prevents cross-project interference. One residual edge case from the previous review remains open.

Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 273 Import-failure paths are now covered, but provider-side silent drops still strand pendingCreate: messages for an unusable/unknown project and state-gate failures are dropped with only a log (no importResult/worktreeSetup is posted), so the slot stays stuck and blocks future cross-project schedules until webview reload
Files Reviewed (2 files)
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 1 issue
  • packages/kilo-vscode/tests/unit/agent-manager-new-worktree-project.test.ts

Fix these issues in Kilo Cloud

Previous review (commit 726f181)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1

Incremental review of commits since 3a72c742 (history was rebased; effective delta is the scheduleCreate guard, a regression test, and a plan-doc note). The previously flagged single-slot pendingCreate overwrite race is fixed: a second cross-project schedule no longer overwrites the in-flight one, so the first import's activation is preserved, and the new test pins the guard. One residual edge case remains around failure paths that never emit a terminating event.

Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 272 pendingCreate is only cleared by worktreeSetup/multiVersionProgress events; silent-drop paths (unusable project, state-gate failure, importer early failures) leave the slot stuck, and the new guard then blocks all future cross-project schedules until webview reload
Files Reviewed (3 files)
  • .kilo/plans/agent-manager-new-worktree-project-selector.md
  • packages/kilo-vscode/tests/unit/agent-manager-new-worktree-project.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit 3a72c74)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1

Incremental review of commits since fa99749. Both previous suggestions are resolved: cross-project imports now schedule activation (props.onCreate?.(target) + activateSelection on ready, with pendingCreate cleared on error), and the project dropdown now has a NewWorktreeProjectDropdown story with a CI-generated screenshot baseline. The test assertions, story mocks (AgentProjectSnapshot fields), and baseline path all line up with the auto-discovered visual-regression spec. One new edge-case race remains in the single-slot pendingCreate overwrite.

Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx 606 Re-import into a different project while a cross-project import is in flight overwrites single-slot pendingCreate; busy rejection emits no worktreeSetup error, so the in-flight import's activation is silently dropped
Files Reviewed (5 files)
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/agentmanager/new-worktree-project-dropdown-chromium-linux.png
  • packages/kilo-vscode/tests/unit/agent-manager-new-worktree-project.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/stories/agent-manager.stories.tsx

Fix these issues in Kilo Cloud

Previous review (commit fa99749)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2

The core design is sound: project-targeted requests resolve through messageProject with per-message trust re-checks (contexts.usable), and ProjectScope uses AsyncLocalStorage so the scoped project correctly propagates through the importer's async operations. Response tagging with projectId plus the webview-side stale-response guards are consistent, types align on both sides of the message boundary, all 20 locales carry the new keys, a changeset is included, and no new memory-leak vectors (unmanaged listeners/timers/subscriptions) were introduced. Two suggestions remain.

Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx 566 Cross-project imports complete silently — no activation or confirmation, unlike the New tab flow
packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css 2831 New project-popover overflow escape hatch lacks Storybook/visual-regression coverage
Files Reviewed (35 files)
  • .changeset/bright-project-picker.md
  • .kilo/plans/agent-manager-new-worktree-project-selector.md
  • packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts
  • packages/kilo-vscode/src/agent-manager/types.ts
  • packages/kilo-vscode/src/agent-manager/worktree-importer.ts
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-new-worktree-project.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/agent-manager/ProjectList.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/ProjectSelect.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css - 1 issue
  • packages/kilo-vscode/webview-ui/agent-manager/i18n/*.ts (20 locales)
  • packages/kilo-vscode/webview-ui/src/hooks/useSlashCommand.ts
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts

Fix these issues in Kilo Cloud


Reviewed by kimi-k3 · Input: 35.7K · Output: 6.8K · Cached: 363.1K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode force-pushed the configure-agent-manager-project-selection branch from aa05710 to 38bff34 Compare August 6, 2026 09:12
Comment thread packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx
@marius-kilocode
marius-kilocode force-pushed the configure-agent-manager-project-selection branch 2 times, most recently from b4fcb2a to 6964024 Compare August 6, 2026 10:23
Comment thread packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
@marius-kilocode
marius-kilocode force-pushed the configure-agent-manager-project-selection branch 3 times, most recently from 16689bb to 113df1a Compare August 6, 2026 11:21
@marius-kilocode
marius-kilocode merged commit 1262724 into main Aug 6, 2026
33 checks passed
@marius-kilocode
marius-kilocode deleted the configure-agent-manager-project-selection branch August 6, 2026 12:46
chrarnoldus pushed a commit to amypoolside/kilocode that referenced this pull request Aug 6, 2026
PR Kilo-Org#12931 grew AgentManagerApp.tsx to 2808 lines, over its 2800
max-lines ESLint cap. Main's push workflows path-filter the lint job so
the breakage is latent there, but every kilo-vscode PR fails merge CI.
Extract the cross-project pending-create controller into
pending-create.ts instead of raising the cap.
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…er-project-selection

feat(agent-manager): target new worktrees by project
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
PR Kilo-Org#12931 grew AgentManagerApp.tsx to 2808 lines, over its 2800
max-lines ESLint cap. Main's push workflows path-filter the lint job so
the breakage is latent there, but every kilo-vscode PR fails merge CI.
Extract the cross-project pending-create controller into
pending-create.ts instead of raising the cap.
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