Fix setup credentials for active profile#838
Open
lucyonegit wants to merge 1 commit into
Open
Conversation
Contributor
Greptile SummaryThis PR makes the first-run setup flow save credentials for the active profile.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "Fix setup credentials for active profile" | Re-trigger Greptile |
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.
问题描述
在初始化 Setup 页面配置模型 Provider 和 API Key 时,桌面端没有把当前正在配置的 active profile 传给保存逻辑。
对于新用户来说通常不会暴露问题,因为没有
active_profile时系统默认使用defaultprofile,Setup 保存和后续读取都会落在default。但对于已有多个 profile 的用户,如果当前 active profile 不是
default,例如work,启动时发现当前 profile 缺少 API Key 并进入 Setup,用户在 Setup 中填写 DashScope / Qwen Key 后,配置可能被写入默认 profile,而不是当前 active profile。进入应用后仍然读取当前 profile,导致用户刚刚填写的 Key 没有生效,看起来像“初始化页配置没有带进来”。解决方案
让 Setup 页面明确接收当前 active profile,并在保存 API Key 和模型配置时传递该 profile。
具体调整:
checkInstall()返回的activeProfiledefaultsetEnv时带上 profilesetModelConfig时带上 profile影响范围
defaultprofile