Skip to content

fix(agent-manager): preserve side panels across context switches - #13610

Merged
marius-kilocode merged 6 commits into
mainfrom
persist-subagent-sidebar-context-across-worktrees
Sep 1, 2026
Merged

fix(agent-manager): preserve side panels across context switches#13610
marius-kilocode merged 6 commits into
mainfrom
persist-subagent-sidebar-context-across-worktrees

Conversation

@marius-kilocode

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

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Switching from Local Diff to another worktree's Subagents could discard the selected panel. Edit previews could also disappear when returning to a session.

Why This Change Was Made

Store panel selection with its owner: Diff, PR, Terminal, and Documents belong to the worktree; Subagents, Edit Preview, and Browser belong to the session. Temporary hiding must not clear that selection.

The scope excludes PR-cache and Diff-scope routing changes. Regression coverage is limited to five focused cases rather than a broad matrix.

User Impact

Returning restores the selected panel and session preview. Explicitly closed panels stay closed. Setup events and Review/History visibility do not erase another context's panel. State is retained within the current Agent Manager webview, not across restarts.

Evidence

  • Five added regression cases cover owner restoration, explicit closes, preview retention, ID-less setup completion, and a Terminal hidden by History/Review. The focused suite passes (130 tests, including existing coverage).
  • Compile, lint, host/webview typechecks, formatting, and Knip pass.
  • Repeated Local Diff/Subagents and mixed session/worktree switching in isolated VS Code: 18 assertions passed. Real UI controls used synthetic transport data; no live model, PTY, or setup script was exercised.

Returning to Session A1 restores its selected Subagents tab

Comment thread packages/kilo-vscode/webview-ui/agent-manager/project/progress.ts Outdated
Comment thread packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/project/progress.ts
Previous Review Summaries (3 snapshots, latest commit 8fdc1bd)

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

Previous review (commit 8fdc1bd)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (14 files)
  • packages/kilo-vscode/tests/unit/agent-manager-ambient-setup.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-diff-scope-state.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-side.test.ts
  • packages/kilo-vscode/tests/unit/edit-preview.test.ts
  • packages/kilo-vscode/tests/unit/pr-panel-state.test.ts
  • packages/kilo-vscode/tests/unit/side-panel-state.test.ts
  • packages/kilo-vscode/tests/unit/subagent-tabs.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/diff-review-scope.ts
  • packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/pr/PRPanel.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/pr/pr-comment-state.ts
  • packages/kilo-vscode/webview-ui/agent-manager/subagent-tabs.ts

Previous review (commit b5ee423)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (7 files)
  • packages/kilo-vscode/tests/unit/agent-manager-ambient-setup.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/tests/unit/side-panel-state.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/BrowserPanel.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/project/progress.ts
  • packages/kilo-vscode/webview-ui/agent-manager/side-panel-state.ts

Previous review (commit cfc3d82)

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/webview-ui/agent-manager/project/progress.ts 40 ID-less ready/error does not clear an overlay that already has a worktreeId
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 549 Ambient setup sees the concealed panel, so History/Review looks like closed
Files Reviewed (20 files)
  • .changeset/remember-subagent-panel.md
  • packages/kilo-vscode/tests/unit/agent-manager-ambient-setup.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-diff-scope-state.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-side.test.ts
  • packages/kilo-vscode/tests/unit/edit-preview.test.ts
  • packages/kilo-vscode/tests/unit/pr-panel-state.test.ts
  • packages/kilo-vscode/tests/unit/side-panel-state.test.ts
  • packages/kilo-vscode/tests/unit/subagent-tabs.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/agent-manager/diff-review-scope.ts
  • packages/kilo-vscode/webview-ui/agent-manager/edit-preview.ts
  • packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/pr/PRPanel.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/pr/pr-comment-state.ts
  • packages/kilo-vscode/webview-ui/agent-manager/project/progress.ts - 1 issue
  • packages/kilo-vscode/webview-ui/agent-manager/project/switch.ts
  • packages/kilo-vscode/webview-ui/agent-manager/side-panel-state.ts
  • packages/kilo-vscode/webview-ui/agent-manager/subagent-tabs.ts
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/ambient.ts

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 103.9K · Output: 8.5K · Cached: 290.8K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode force-pushed the persist-subagent-sidebar-context-across-worktrees branch from cfc3d82 to b5ee423 Compare August 31, 2026 13:47
Comment thread packages/kilo-vscode/webview-ui/agent-manager/project/progress.ts Outdated
@marius-kilocode
marius-kilocode merged commit e2c26fc into main Sep 1, 2026
25 checks passed
@marius-kilocode
marius-kilocode deleted the persist-subagent-sidebar-context-across-worktrees branch September 1, 2026 09:21
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