fix(setup): restore sibling built-in entries when re-running setup wizard#4673
Merged
SivanCola merged 1 commit intoJun 17, 2026
Conversation
…zard withBuiltinFamiliesForLanguage previously deduplicated by family key, so a user who had only deepseek-flash (with model deepseek-v4-flash) in their config caused the entire deepseek family to be considered 'already present'. The sibling deepseek-pro entry was never appended, making deepseek-v4-pro invisible in the model picker on re-run. Change deduplication from family-key level to entry-name level so that all built-in entries within an existing family are appended when missing, while user-customized entries (same exact name) are preserved as-is. Add regression test TestWithBuiltinFamiliesRestoresSiblingEntries.
SivanCola
approved these changes
Jun 17, 2026
SivanCola
left a comment
Collaborator
There was a problem hiding this comment.
Approved. This is a well-scoped fix. The PR corrects setup re-run model selection by changing built-in family supplementation from family-key dedupe to exact provider-name dedupe, so a saved deepseek-flash entry no longer hides deepseek-pro. Existing same-name user entries remain preserved, and buildFamilyEntries continues to keep per-SKU pricing/metadata after selection.
Reviewed:
- Baseline: latest main-v2 and PR head diff; mergeability is clean.
- Related PRs: #4518 touches the same file in chatREPL only; no conflict with setup provider logic.
- Security/cache: no new I/O, network calls, dependencies, prompt/tool schema changes, or provider request serialization changes.
- Tests:
go test ./internal/cli -count=1 -run 'TestWithBuiltinFamilies';go test ./internal/config -count=1 -run 'TestBackfillDeepSeekPro|TestNormalizeLegacyProviderModels|TestResetOfficialProviderPricingOnUpgradeRunsOnce';git diff --check origin/main-v2...origin/pr/4673; CI is green.
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.
Bug Description
After selecting a DeepSeek model using
reasonix setup(e.g., selecting onlydeepseek-v4-flash),running
reasonix setupagain causes the model selection list to display only the previously selected model;other available models (such as
deepseek-v4-pro) are not visible.Root Cause
withBuiltinFamiliesForLanguageperforms deduplication based on the family key: since the user already hasdeepseek-flash(which belongs to the
deepseekfamily), the entire family is considered "already present." Consequently, the built-indeepseek-proentry is not added, leaving the static model fallback list containing only the single previously selected model.
Fix
Change the deduplication logic from by family key to by entry name:
deepseek-flash) remain unchanged.deepseek-pro) are automatically added.This ensures
familyStaticModelsreturns the complete list of models.Testing
TestWithBuiltinFamiliesRestoresSiblingEntriesBug 描述
使用
reasonix setup选择了一个 DeepSeek 模型后(如只选了deepseek-v4-flash),再次运行
reasonix setup时,模型选择列表只显示之前选过的模型,无法看到其他可选模型(如
deepseek-v4-pro)。根因
withBuiltinFamiliesForLanguage按 family key 去重:用户已有deepseek-flash(属于
deepseekfamily),整个 family 被认为"已存在",导致内置的deepseek-pro条目不会被补充,模型静态回退列表只有之前选过的一个模型。
修复
将去重逻辑从 按 family key 改为 按 entry name:
deepseek-flash)保持不变deepseek-pro)会被自动补充这样
familyStaticModels就能返回完整的模型列表。测试
TestWithBuiltinFamiliesRestoresSiblingEntries