fix: resolve_alias prefers highest version + merges static catalog
Three bugs fixed in model alias resolution: 1. resolve_alias() returned the FIRST catalog match with no version preference. '/model mimo' picked mimo-v2-omni (index 0 in dict) instead of mimo-v2.5-pro. Now collects all prefix matches, sorts by version descending with pro/max ranked above bare names, and returns the highest. 2. models.dev registry missing newly added models (e.g. v2.5 for native xiaomi). resolve_alias() now merges static _PROVIDER_MODELS entries into the catalog so models resolve immediately without waiting for models.dev to sync. 3. hermes model picker showed only models.dev results (3 xiaomi models), hiding curated entries (5 total). The picker now merges curated models into the models.dev list so all models appear. Also fixes a trailing-dot float parsing edge case in _model_sort_key where '5.4.' failed float() and multi-dot versions like '5.4.1' weren't parsed correctly.
This commit is contained in:
+12
-1
@@ -3984,7 +3984,18 @@ def _model_flow_api_key_provider(config, provider_id, current_model=""):
|
||||
pass
|
||||
|
||||
if mdev_models:
|
||||
model_list = mdev_models
|
||||
# Merge models.dev with curated list so newly added models
|
||||
# (not yet in models.dev) still appear in the picker.
|
||||
if curated:
|
||||
seen = {m.lower() for m in mdev_models}
|
||||
merged = list(mdev_models)
|
||||
for m in curated:
|
||||
if m.lower() not in seen:
|
||||
merged.append(m)
|
||||
seen.add(m.lower())
|
||||
model_list = merged
|
||||
else:
|
||||
model_list = mdev_models
|
||||
print(f" Found {len(model_list)} model(s) from models.dev registry")
|
||||
elif curated and len(curated) >= 8:
|
||||
# Curated list is substantial — use it directly, skip live probe
|
||||
|
||||
Reference in New Issue
Block a user