Repository navigation
Conversation
…ault Models explicitly declared in the user's config (provider.<id>.models) were hidden from the web/Desktop model picker unless they happened to be the latest release of their family. The user added them on purpose — they should be visible by default, with user show/hide preferences still taking precedence. Fixes the config-declared variant of #49605; related to #47557 (same visible()/latestSet logic).
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Author
|
Closing at author's request. |
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
Models explicitly declared in the user's config (
provider.<id>.models) are hidden from the web/Desktop model picker unless they happen to be the latest release of their family. The user added them on purpose — they should be visible by default.Repro (measured on 1.18.32 Desktop): config declares
openrouter → z-ai/glm-5.3(limit + cost). The model is listed by the CLI and served by the runtime, but the picker hides it: its familyglmhas a newer release (z-ai/glm-5.3-prime, 2026-09-23 vs 2026-08-14), solatestSetdoesn't include it andvisible()returnsfalse. The user sees "GLM 5.3 Prime" and "GLM Flash" under OpenRouter, but not the model they explicitly configured.Root cause
visible()inpackages/app/src/context/models.tsx:Same
visible()/latestSetlogic reported in #49605 (config-declared models hidden via thereleased: 0→ "1970-01-01" coercion) and #47557 (family-less catalog models dropped bygroupBy). This PR fixes the config-declared variant: a model the user explicitly declared in their config should not depend on release-date heuristics to be visible.Change
customModelKeysFromConfig(config)inpackages/app/src/context/model-keys.ts— extractsproviderID:modelIDkeys fromconfig.provider.<id>.models(defensive against missing/invalid shapes).ModelsProvidernow consumesserverSync().data.config(already available in the store) andvisible()returnstruefor config-declared models after user preferences (show/hidestill win) and before thelatestSetheuristic.Behavior after
z-ai/glm-5.3)Testing
packages/app/src/context/models.test.ts(7 cases) covering the extraction helper: typical config, empty/null/undefined config, providers withoutmodels, non-objectmodels, multiple providers.bun turbo typecheck: 30/30 packages pass.provider.<id>.models, restart, confirm it appears in the picker and in "Manage models" (toggle born checked); toggling it off still hides it.Notes