feat(vscode): add git worktree support for agent manager sessions#418
Merged
marius-kilocode merged 13 commits intodevfrom Feb 18, 2026
Merged
feat(vscode): add git worktree support for agent manager sessions#418marius-kilocode merged 13 commits intodevfrom
marius-kilocode merged 13 commits intodevfrom
Conversation
packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
Outdated
Show resolved
Hide resolved
Contributor
Code Review SummaryStatus: 17 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)WARNING
SUGGESTION
Positive Observations
Files Reviewed (11 files)
|
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
Outdated
Show resolved
Hide resolved
…nMode type, remove premature delete handling
…leak, add cleanup regression tests - Remove messageDirectory class field; pass dir as parameter to all handler methods - Only trust directory override when onBeforeMessage interceptor is attached - Add proper type for CreateWorktreeSessionRequest, remove `as any` cast - Fix onMessage listener leak with onCleanup in AgentManagerApp - Use removeWorktree() for pre-creation cleanup instead of inline fs.rm - Add regression tests for orphaned directory removal and cleanup before re-creation
…l-spec # Conflicts: # packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx # packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
…l-spec # Conflicts: # packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
markijbema
reviewed
Feb 18, 2026
iscekic
approved these changes
Feb 18, 2026
Contributor
iscekic
left a comment
There was a problem hiding this comment.
Nothing stands out. I do believe some of the bot comments are valid or at least cheap to address. Approving to unblock.
…e import - KiloProvider: add sessionDirectories map and setSessionDirectory() - getWorkspaceDirectory() resolves by sessionId lookup instead of per-message override - Remove dir param from all 18 handler methods — they resolve directory from their sessionId - AgentManagerProvider: call setSessionDirectory() at session creation and recovery - Remove directory injection from message interceptor (interceptor only routes custom messages) - Fix duplicate ExtensionMessage import in AgentManagerApp.tsx - Forward agent param in worktree session creation
…l-spec # Conflicts: # packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
… track recovered sessions for SSE, log metadata write failures
…ries into loadSessions - handleLoadSessions fetches sessions from all registered worktree directories and merges them into the response (deduped by session ID) - recoverWorktrees result is awaited by the interceptor before loadSessions passes through, ensuring sessionDirectories are populated first - Fixes: worktree sessions disappearing after VS Code restart
…overy instead of blocking loadSessions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.kilocode/worktrees/{branch}/Architecture
onBeforeMessageinterceptor on KiloProvider to route custom messages (createWorktreeSession) and injectdirectoryon session-scoped messages for worktree sessionsregisterSession,trackSession,attachToWebviewinterceptor support, and a per-messagemessageDirectoryoverride that flows throughgetWorkspaceDirectory()/global/eventendpoint and unwraps{ directory, payload }envelopeNo
SessionTerminalManagerorWorktreeSessionManager— kept it minimal.