fix(models): honor visible pinned IDs in route selection (#6922)

This commit is contained in:
red person
2026-10-31 13:51:59 +00:00
committed by GitHub
parent 9276db9c11
commit 72e8520fa3
4 changed files with 125 additions and 23 deletions
+8 -8
View File
@@ -289,15 +289,15 @@ def _resolve_run_endpoint(db, task: ScheduledTask, run: TaskRun) -> str:
try:
from core.database import ModelEndpoint
eps = db.query(ModelEndpoint).filter(ModelEndpoint.is_enabled == True).all()
from src.auth_helpers import owner_filter
from src.endpoint_resolver import _endpoint_enabled_models
eps = owner_filter(
db.query(ModelEndpoint).filter(ModelEndpoint.is_enabled == True),
ModelEndpoint, getattr(task, "owner", None),
).all()
for ep in eps:
cached = []
if ep.cached_models:
try:
cached = json.loads(ep.cached_models) or []
except Exception:
cached = []
if model in cached:
if model in _endpoint_enabled_models(ep):
return ep.base_url or ""
except Exception:
pass