Skip to content

fix(vscode): persist Agent Manager dialog selections - #12927

Merged
marius-kilocode merged 2 commits into
mainfrom
cache-modal-selection-state
Aug 6, 2026
Merged

fix(vscode): persist Agent Manager dialog selections#12927
marius-kilocode merged 2 commits into
mainfrom
cache-modal-selection-state

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

The Agent Manager New Worktree dialog reset model, variant, mode, and sandbox selections whenever it closed, forcing repeated setup while the prompt draft remained. Persist these selections in webview state and restore them on the next open. Stored values are validated before use, and the server sandbox response remains authoritative. This includes a patch changeset for the user-facing fix.

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

kilo-code-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Both previous warnings (unvalidated restored agent/model) are resolved in f46c8e1: restoreAgent now checks the saved agent against the live agent list with a session.selectedAgent() fallback, and restoreModel validates the saved model through provider.isModelValid() (provider exists, connected, model present) with a session.modelForAgent() fallback. The new helpers are pure functions — no new effects, subscriptions, or timers, so no memory-leak surface. No new issues found in the incremental diff.

Files Reviewed (1 file)
  • packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx
Previous Review Summary (commit 58f8b02)

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

Previous review (commit 58f8b02)

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/NewWorktreeDialog.tsx 143 Restored agent isn't validated against the current agent list; a renamed/removed agent would render as a raw label and be submitted to the server
packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx 144 Restored model bypasses provider validation (resolveModelSelection/isModelValid); a disconnected provider or removed model would be submitted stale
Files Reviewed (2 files)
  • .changeset/cache-worktree-dialog-selections.md - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx - 2 issues

The persistence mechanism itself is solid: type validation in readDialogSelections, the server-authoritative sandbox flow, and the owner-scoped persist effect (no leak risk) all look correct. Both findings are the same class — restored values are type-checked but not existence-checked against live session/provider data, which the pre-change code path guaranteed.

Fix these issues in Kilo Cloud


Reviewed by kimi-k3 · Input: 68.8K · Output: 10.4K · Cached: 842.6K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 30221fe into main Aug 6, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the cache-modal-selection-state branch August 6, 2026 08:02
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…-state

fix(vscode): persist Agent Manager dialog selections
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