fix: include unmapped models in recommended list#8336
fix: include unmapped models in recommended list#8336Bahtya wants to merge 1 commit intoaaif-goose:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebbf6ddf89
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| None => { | ||
| // Unmapped model — include it anyway so new/unknown models | ||
| // are available in the UI dropdown. | ||
| return Some((model.clone(), None)); | ||
| } |
There was a problem hiding this comment.
Preserve capability checks for unmapped models
Returning Some((model.clone(), None)) here causes unmapped models to skip the later text-modality and tool-callability filters, so they are treated as recommended even when they are not usable for Goose chat/tool flows. This is a regression for providers that list mixed model types from their catalog endpoints (for example, google.rs fetches all v1beta/models entries, and openai.rs collects every /v1/models id): previously those unmapped entries were excluded when mapped usable models existed, but now unsupported image/audio/video models can appear in the dropdown and fail with 4xx when selected for normal chat requests.
Useful? React with 👍 / 👎.
ebbf6dd to
d403be7
Compare
|
Thanks @michaelneale! I've amended the commit with the DCO sign-off and force-pushed. Let me know if there's anything else needed. |
1 similar comment
|
Thanks @michaelneale! I've amended the commit with the DCO sign-off and force-pushed. Let me know if there's anything else needed. |
Previously, models not found in CanonicalModelRegistry were silently dropped from the recommended list, making new models (e.g. claude-opus-4-6, gemini-3.1-pro) invisible in the UI dropdown. Now, unmapped models are included in the list without a release date, sorted after dated models. This allows users to select any model returned by the provider's /v1/models endpoint. Fixes aaif-goose#8321 Signed-off-by: bahtya <bahtyar153@qq.com>
Summary
Fixes #8321
Previously, models not found in
CanonicalModelRegistrywere silently dropped from the recommended models list. This made newly released models (e.g.claude-opus-4-6-thinking,gemini-3.1-pro, OpenRouter models) invisible in the UI dropdown, forcing users to type model names manually.Fix
In
fetch_recommended_models(), whenmap_to_canonical_model()returnsNone(model not in registry), include the model anyway withNoneas its release date. Unmapped models are sorted after dated models in the dropdown.Before: Unmapped models silently dropped → not selectable in UI
After: All models from provider's
/v1/modelsendpoint are availableChanges
crates/goose/src/providers/base.rs: Changedfilter_mapto include unmapped models instead of silently dropping them (10 lines added, 1 removed)Testing
The fix preserves existing behavior for mapped models (sorted by release date) while adding unmapped models at the end of the list.