fix(model-switch): mark bare custom provider as current
This commit is contained in:
@@ -1720,7 +1720,10 @@ def list_authenticated_providers(
|
|||||||
results.append({
|
results.append({
|
||||||
"slug": slug,
|
"slug": slug,
|
||||||
"name": grp["name"],
|
"name": grp["name"],
|
||||||
"is_current": slug == current_provider,
|
"is_current": slug == current_provider or (
|
||||||
|
bool(current_base_url)
|
||||||
|
and _grp_url_norm == current_base_url.strip().rstrip("/").lower()
|
||||||
|
),
|
||||||
"is_user_defined": True,
|
"is_user_defined": True,
|
||||||
"models": grp["models"],
|
"models": grp["models"],
|
||||||
"total_models": len(grp["models"]),
|
"total_models": len(grp["models"]),
|
||||||
|
|||||||
@@ -343,6 +343,7 @@ def test_list_authenticated_providers_bare_custom_slug_recovers(monkeypatch):
|
|||||||
group = matches[0]
|
group = matches[0]
|
||||||
# Canonical slug, NOT the bare "custom" that caused #17478
|
# Canonical slug, NOT the bare "custom" that caused #17478
|
||||||
assert group["slug"] == "custom:ollama"
|
assert group["slug"] == "custom:ollama"
|
||||||
|
assert group["is_current"] is True
|
||||||
|
|
||||||
|
|
||||||
def test_list_authenticated_providers_distinct_endpoints_stay_separate(monkeypatch):
|
def test_list_authenticated_providers_distinct_endpoints_stay_separate(monkeypatch):
|
||||||
|
|||||||
Reference in New Issue
Block a user