fix(combos): expose synced reasoning-effort variants in Combo Builder model picker (#8072) - #8165
Conversation
… model picker (#8072) Synced reasoning-effort aliases (e.g. GLM-5.2-high, GLM-5.2-medium) appear in the catalog and Playground but were missing from the Combo Builder's inline model picker. buildModelOptions() added base synced records but never ran appendSyncedEffortVariants(). Convert synced models with non-empty supportedThinkingEfforts into catalog-shaped entries, run the shared appendSyncedEffortVariants utility (preserving its effort normalization, provider exclusions, suffix-collision handling, and naming behavior), and add any new variant ids to the builder model map. Variants inherit the base model's endpoints, context length, output limit, and thinking support.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90b833e5c4
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const catalogShaped = syncedModels | ||
| .filter( | ||
| (m): m is SyncedModelLike & { id: string; supportedThinkingEfforts: string[] } => | ||
| typeof m.id === "string" && | ||
| Array.isArray(m.supportedThinkingEfforts) && | ||
| m.supportedThinkingEfforts.length > 0 | ||
| ) |
There was a problem hiding this comment.
Preserve hidden filtering when adding variants
When a synced base model is hidden, the first loop drops it through addModelOption(), but this new pass starts again from the raw syncedModels list and synthesizes base-high/base-medium aliases anyway. Because addModelOption() only checks the synthetic alias id, not the hidden base id, any user-hidden synced model with supportedThinkingEfforts can reappear in the Combo Builder picker under its effort variants and be selected despite being hidden.
Useful? React with 👍 / 👎.
| const baseId = | ||
| typeof variant.root === "string" | ||
| ? variant.root.startsWith(`${providerId}/`) | ||
| ? variant.root.slice(providerId.length + 1) | ||
| : variant.root |
There was a problem hiding this comment.
Look up the real base model before copying metadata
For entries returned by appendSyncedEffortVariants(), variant.root is already suffixed (for example GLM-5.2-high), so this computes baseId as the variant id rather than the original base GLM-5.2. The following modelMap.get(baseId) misses, which means every newly exposed effort option falls back to the raw id as its label and loses the base model's supported endpoints, context length, output limit, and thinking flag.
Useful? React with 👍 / 👎.
) appendSyncedEffortVariants sets a variant's own root field to ${baseRoot}-${tier} (still tier-suffixed), not the true base model id. buildModelOptions() was deriving baseId from variant.root, so the lookup into modelMap never matched and every <model>-<tier> variant silently fell back to bare defaults instead of inheriting contextLength, outputTokenLimit, supportedEndpoints, and supportsThinking from its base model. Track each variant's true base raw id directly while iterating tiers during catalogShaped construction instead of re-deriving it from variant.root. Adds a regression test seeding a synced model with supportedThinkingEfforts via replaceSyncedAvailableModelsForConnection and asserting the resulting <model>-<tier> variants both appear and inherit the base entry's metadata through getComboBuilderOptions(). Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
|
Obrigado, @Dingding-leo — mergeado na |
GET /v1/models was assembled by many independent push loops (auto-combos, named combos, static registry, codex-native, synced, OpenRouter, specialty, custom, alias-backed, connection-fallback), so one provider's models landed in several separated, interleaved blocks. Apply ONE stable, provider-grouped sort at serialization in finalizeCatalogResponse, keyed by owned_by (canonical owner identity) rather than the model-id prefix — so a single routable public prefix that differs from its owner (e.g. no-auth OpenCode publishing oc/<model> while keeping owned_by "opencode") stays contiguous. Combos are pinned first (preserving diegosouzapw#4164); then providers in registry precedence (OAuth -> NoAuth -> API-key); then unknown providers in locale-independent code-unit order. The sort is stable and pure (reorders rows only, no mutation, no DB/IO), preserving combo sort_order, connection priority, custom append-order, and equal-id audio twins. Identity, alias mapping, effort variants, dedupe, and Claude-mirror gating are untouched. This is the one enumerated Model-Identity behavior with no upstream equivalent on release/v3.8.50: single public prefix / UUID-leak (diegosouzapw#8327/diegosouzapw#8361) and Combo Builder effort variants (diegosouzapw#8072/diegosouzapw#8165) are already merged there.
… model picker (diegosouzapw#8072) (diegosouzapw#8165) * fix(combos): expose synced reasoning-effort variants in Combo Builder model picker (diegosouzapw#8072) Synced reasoning-effort aliases (e.g. GLM-5.2-high, GLM-5.2-medium) appear in the catalog and Playground but were missing from the Combo Builder's inline model picker. buildModelOptions() added base synced records but never ran appendSyncedEffortVariants(). Convert synced models with non-empty supportedThinkingEfforts into catalog-shaped entries, run the shared appendSyncedEffortVariants utility (preserving its effort normalization, provider exclusions, suffix-collision handling, and naming behavior), and add any new variant ids to the builder model map. Variants inherit the base model's endpoints, context length, output limit, and thinking support. * fix(combos): correct baseId derivation for synced effort variants (diegosouzapw#8072) appendSyncedEffortVariants sets a variant's own root field to ${baseRoot}-${tier} (still tier-suffixed), not the true base model id. buildModelOptions() was deriving baseId from variant.root, so the lookup into modelMap never matched and every <model>-<tier> variant silently fell back to bare defaults instead of inheriting contextLength, outputTokenLimit, supportedEndpoints, and supportsThinking from its base model. Track each variant's true base raw id directly while iterating tiers during catalogShaped construction instead of re-deriving it from variant.root. Adds a regression test seeding a synced model with supportedThinkingEfforts via replaceSyncedAvailableModelsForConnection and asserting the resulting <model>-<tier> variants both appear and inherit the base entry's metadata through getComboBuilderOptions(). Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Austin Liu <austinliu@Austins-MacBook-Air-3.local> Co-authored-by: Probe Test <probe@example.com> Co-authored-by: Dingding-leo <Dingding-leo@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
… model picker (diegosouzapw#8072) (diegosouzapw#8165) * fix(combos): expose synced reasoning-effort variants in Combo Builder model picker (diegosouzapw#8072) Synced reasoning-effort aliases (e.g. GLM-5.2-high, GLM-5.2-medium) appear in the catalog and Playground but were missing from the Combo Builder's inline model picker. buildModelOptions() added base synced records but never ran appendSyncedEffortVariants(). Convert synced models with non-empty supportedThinkingEfforts into catalog-shaped entries, run the shared appendSyncedEffortVariants utility (preserving its effort normalization, provider exclusions, suffix-collision handling, and naming behavior), and add any new variant ids to the builder model map. Variants inherit the base model's endpoints, context length, output limit, and thinking support. * fix(combos): correct baseId derivation for synced effort variants (diegosouzapw#8072) appendSyncedEffortVariants sets a variant's own root field to ${baseRoot}-${tier} (still tier-suffixed), not the true base model id. buildModelOptions() was deriving baseId from variant.root, so the lookup into modelMap never matched and every <model>-<tier> variant silently fell back to bare defaults instead of inheriting contextLength, outputTokenLimit, supportedEndpoints, and supportsThinking from its base model. Track each variant's true base raw id directly while iterating tiers during catalogShaped construction instead of re-deriving it from variant.root. Adds a regression test seeding a synced model with supportedThinkingEfforts via replaceSyncedAvailableModelsForConnection and asserting the resulting <model>-<tier> variants both appear and inherit the base entry's metadata through getComboBuilderOptions(). Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Austin Liu <austinliu@Austins-MacBook-Air-3.local> Co-authored-by: Probe Test <probe@example.com> Co-authored-by: Dingding-leo <Dingding-leo@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Summary
Fixes #8072. Synced reasoning-effort aliases (e.g.
GLM-5.2-high,GLM-5.2-medium,GLM-5.2-low) appear in the catalog and Playground but were missing from the Combo Builder's inline model picker.buildModelOptions()added base synced records but never ranappendSyncedEffortVariants().Changes
src/lib/combos/builderOptions.ts:supportedThinkingEffortstoSyncedModelLiketypeappendSyncedEffortVariantsfrom the shared utilitysupportedThinkingEffortsinto catalog-shaped entries, runappendSyncedEffortVariants(), and add new variant ids to the model mapVerification
npx tsc --pretty false -p tsconfig.typecheck-core.json— zero errorscombo-builder-options-route.test.ts+combo-builder-model-source-5477.test.ts+sync-reasoning-supported-efforts-7694.test.ts— 27/27 pass1 file changed, +51 −3