fix: agent-manager model sync on config change#10094
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Previous Issues (all resolved)All issues raised across this review cycle have been addressed:
Files Reviewed (3 files)
Reviewed by claude-4.6-sonnet-20260217 · 331,056 tokens Review guidance: REVIEW.md from base branch |
…e overrides on config change - Replace session.selected() with session.configModel() in NewWorktreeDialog to reflect the configured model rather than the selected session model. - Add configModel to SessionContext and implement an effect that clears session overrides matching the old config model when the global config model changes, ensuring sessions pick up the new config model.
29d3310 to
e1e75a3
Compare
|
@IamCoder18 my bot sais this fix doesn't work for the new worktree modal? (cmd shift n), is this true? NewWorktreeDialog.tsx:88 initializes from session.configModel(). |
You're right. I had only tested local sessions, not sessions in worktrees or the New Worktree modal. I'll fix this later today. |
Use session.configModel() instead of session.selected() in NewWorktreeDialog so the overridden comparison (line 124) and the reset handler (line 444) both use the config-based model. This prevents stale overridden states from session.selected() from leaking into the worktree dialog's override detection and reset behaviour. Partially fixes Kilo-Org#9349.
@marius-kilocode Fixed! 2026-05-22.17-18-16.mp4 |
|
Looks good @IamCoder18, thanks for the fix! |
Context
When a user changes the model in Settings, the sidebar chat updates correctly, but the Agent Manager continues using the old model. This happens because:
sessionOverridesthat short-circuit config-based model resolutionNewWorktreeDialogcapturessession.selected()at dialog open time, including stale overridesCloses #9349
Implementation
NewWorktreeDialog.tsx:
session.selected()tosession.configModel()for model initializationsession.tsx:
configModel()function inSessionContextValueinterface and context valuecreateEffectthat watchesgetGlobalModel()and clearssessionOverrideswhen the config model changesThe reactive effect uses SolidJS signals to track the previous config model and compares it with the current value. When they differ, overrides matching the old config are removed via
produce()for batched store updates.Screenshots
Before
before.mp4
After
after.mp4
How to Test