fix: CLI hardcoded defaults override desktop config#1
Open
zhongyang180 wants to merge 1 commit into
Open
Conversation
Commander's .option() third argument sets a default value, causing opts.model and opts.provider to never be undefined. This makes the nullish coalescing (??) fallback to desktopConfig ineffective — users who configure a non-deepseek provider via `openbot login` or desktop settings still get deepseek/deepseek-chat. Remove the hardcoded defaults so opts.model/opts.provider are undefined when not explicitly passed, allowing desktopConfig to take effect as intended. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
.option()defaults ("deepseek-chat"/"deepseek") for--modeland--providerflags??) fallback todesktopConfigto work correctly, so users who configure a non-deepseek provider viaopenbot loginor desktop settings get their configured modelProblem
Commander.option("--model <id>", "模型 ID", "deepseek-chat")setsopts.modelto"deepseek-chat"when the user doesn't pass--model. Since the value is a string (notundefined), the fallback logic on line 75:never reaches
desktopConfig?.model. The same issue applies to--provider.Test plan
openbot login dashscope <key> qwen-plusthenopenbot "test"→ should usedashscope/qwen-plusopenbot --model deepseek-chat --provider deepseek "test"→ should still work with explicit flagsopenbot "test"with no desktop config → should fallback todeepseek/deepseek-chat🤖 Generated with Claude Code