Repository navigation
fix(vscode): default model not persistent after explicit user choice - #14180
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The incremental commit Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit fa6cc2d)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit fa6cc2d)Status: 1 Issue Found | Recommendation: Address before merge Reviewed the incremental commits Overview
Issue Details (click to expand)WARNING
Incremental Files Reviewed (18 files)
Fix these issues in Kilo Cloud Previous review (commit dd2f2f9)Status: 6 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (23 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
Self-test report: model and effort persistenceTested in a real isolated VS Code Extension Development Host (dev mode) with the bundled CLI backend. The extension was built from this PR head.
Baseline on main (bug reproduced)The explicit model and effort were set in mode Code, then the mode was changed.
This PR (all variations)
Persisted state after the last explicit choice:
Case 11 shows that a CLI or TUI rewrite of the shared Automated checks
Not covered
ResultThe reported issue is fixed. The explicit model and effort survive mode changes in the sidebar, the Agent Manager, and the New Worktree dialog, and they survive a VS Code restart and a CLI or TUI state reset. The cases listed under Not covered remain unverified. |
Document why updating shared effort defaults must preserve an untouched draft on Default, and why generated mode-only command drafts must retain the outgoing model and effort together. Both fixes and their regression tests shipped in 50f7d01; this follow-up only clarifies release notes and code comments.
|
@marius-kilocode mind having a (hopefully) final look? all issues have been addressed and resolved, regressions are tested, behavior seems to be the expected one + edge cases solved, thanks. |
What Problem This Solves
Fixes #14178. Switching modes in Agent Manager could discard the selected model and reasoning effort. Choosing a model for a new session also failed to reliably become the default for subsequent sessions, allowing configured or organization defaults to replace an explicit choice.
Why This Change Was Made
Defaults should initialize an untouched choice, not erase user intent. Preserve scoped selections and remember the latest explicit new-session model/effort pair across modes. Keep that pair in extension-owned state so CLI/TUI updates to the shared model file cannot remove it, without changing upstream client behavior.
User Impact
Evidence
Before this change, the mode-switch handler deleted the session model override and cleared remembered mode choices; the worktree dialog explicitly reset both model and effort. Those destructive resets are gone. Regression cases reproduced the unwanted replacement before the fix and now retain the original combo, including the actual outgoing request.
While refining the review fixes, regression testing exposed two additional cases. Both are fixed and tested in
50f7d01ad7;fa6cc2d4fdadds explanatory release notes and code comments without changing behavior:highin B also changed untouched A from Default tohigh. Updating shared defaults now snapshots the displayed effort of other open drafts, including Default. This is separate from model/mode switching, where an unset effort must remain distinct from an explicit Default choice.Coverage exercises the real SessionProvider, real sidebar tab lifecycle, directly imported reactive dialog logic, history recovery, and real preference files. It includes late hydration and reconnect retries, temporary model/effort disappearance, concurrent saves, and a simulated TUI rewrite that must not erase the saved pair.
Local compilation, typechecks, lint, guards, 358 focused tests, and the real-provider integration test pass. The full unit suite has 5,501 passes and the same 312 baseline environment failures: sandbox-blocked Git fixtures and one unrelated process-helper test. The documentation-only follow-up also passed lint and 74 targeted tests.