Fix chat readiness for picker model override#839
Open
lucyonegit wants to merge 1 commit into
Open
Conversation
Contributor
| const provider = (override?.provider ?? mc.provider ?? "") | ||
| .trim() | ||
| .toLowerCase(); | ||
| const model = (override?.model ?? mc.model ?? "").trim(); |
Contributor
There was a problem hiding this comment.
When the readiness override object contains model: "", this line keeps the empty value instead of falling back to the persisted model. The send path falls back for an empty override model, so this can show NO_ACTIVE_MODEL and block a send that would otherwise use the configured default model.
Suggested change
| const model = (override?.model ?? mc.model ?? "").trim(); | |
| const model = (override?.model || mc.model || "").trim(); |
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.
问题描述
在 Chat 页面底部的模型选择器中,用户已经选择了模型,例如
qwen3.7-plus,但聊天输入框上方仍然可能显示:No model selected. Pick one in Models or the Chat picker.原因是发送前的 readiness 校验只读取持久化的全局模型配置,也就是
config.yaml里的默认模型;而 Chat 底部 picker 选择的是当前会话的临时模型覆盖值。当全局默认模型为空,但当前 Chat picker 已经选中模型时,实际发送消息会使用 picker 里的模型,但 readiness 校验仍然误判为“没有选择模型”,导致界面出现错误提示。
解决方案
让发送前 readiness 校验使用当前 Chat picker 的实际选择。
具体调整:
validateChatReadiness时传入当前 picker 的provider / model / baseUrlvalidateChatReadiness支持接收模型配置 overrideNO_ACTIVE_MODEL影响范围