{{ message }}
Repository navigation
Conversation
Kobalte Select auto-fires onChange when its controlled value prop changes externally (e.g. switching session tabs), which spuriously triggered agent.set/variant.set. The agent's configured default model then overwrote the user-selected model in saved.session[sessionID], causing all sessions in the same workspace to silently revert to the same default model. Three-layer fix: - ui/select.tsx: skip onSelect when new value equals current value - app/prompt-input.tsx: guard all 4 agent/variant onSelect callbacks - app/local.tsx: agent.set preserves prev model/variant when agent unchanged, so even a spurious trigger cannot overwrite user selection
Contributor
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Tested this patch on Windows 10 Pro 22H2 (build 19045) and can confirm it fixes the issue. Before the patch, switching between sessions would reset the model from the session-specific choice (e.g., deepseek) back to the agent default (kimi). After applying the patch and building the Desktop app with OPENCODE_CHANNEL=prod, session switches now correctly preserve the previously used model. Build / test environment:
Thanks for the fix! |
3 of 6 tasks
|
Also hitting this on Desktop — switching sessions silently reverts to agent default model every time. Same root cause as described. Eagerly waiting for this to land, thanks for the fix! |
3 of 6 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Kobalte Select auto-fires onChange when its controlled value prop changes externally (e.g. switching session tabs), which spuriously triggered agent.set/variant.set. The agent's configured default model then overwrote the user-selected model in saved.session[sessionID], causing all sessions in the same workspace to silently revert to the same default model.
Three-layer fix:
Issue for this PR
Closes #35899
Type of change
What does this PR do?
切换会话时,模型选择器的 Select 组件会错误触发 onChange,导致 agent.set 把插件配置的默认模型覆盖了用户选的模型。修复了三层:Select 组件本身加守卫、回调处加守卫、agent.set 函数内部也加守卫,确保用户选中的模型不会被覆盖。
Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.
If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
在Web应用上测试:两个使用不同模型的会话,反复切换它们,每个会话保留自己的模型。
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.