Skip to content

fix(vscode): preserve plan opens across worktree switches - #13970

Merged
marius-kilocode merged 2 commits into
mainfrom
fix-plan-persistence-on-worktree-switch
Sep 9, 2026
Merged

marius-kilocode merged 2 commits into
mainfrom
fix-plan-persistence-on-worktree-switch

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Completed plan events from an inactive Agent Manager worktree were discarded to prevent opening the plan in the wrong worktree. Returning to that worktree then left the plan closed.

Why This Change Was Made

Plan-open candidates are now queued by session and part ID when their session is inactive. The queue flushes when that exact session becomes active, and the active session is checked again before dispatch. Shared deduplication still prevents duplicate opens across nested DataBridge instances.

User Impact

Plans never open in an inactive worktree, and plans completed while another worktree is selected open when the user returns to their owning session.

Evidence

  • bun test tests/unit/open-plan.test.ts
  • bun run lint
  • bun run compile
  • Isolated VS Code Agent Manager self-test with two disposable worktrees: inactive plan stayed closed in worktree A, then opened in worktree B and rendered B-specific file content.

@kilo-code-bot

kilo-code-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • .changeset/defer-inactive-plan-opens.md
  • packages/kilo-vscode/tests/unit/open-plan.test.ts
  • packages/kilo-vscode/webview-ui/src/App.tsx
  • packages/kilo-vscode/webview-ui/src/utils/open-plan.ts
Previous Review Summary (commit fa986a1)

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

Previous review (commit fa986a1)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • .changeset/defer-inactive-plan-opens.md
  • packages/kilo-vscode/tests/unit/open-plan.test.ts
  • packages/kilo-vscode/webview-ui/src/App.tsx
  • packages/kilo-vscode/webview-ui/src/utils/open-plan.ts

Reviewed by grok-4.6 · Input: 59.7K · Output: 4.5K · Cached: 142.6K

Review guidance: REVIEW.md from base branch main

Comment thread packages/kilo-vscode/webview-ui/src/utils/open-plan.ts
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