fix(endpoint): import ModelEndpoint from core database
ModelEndpoint is defined in core.database, not src.database. The wrong import silently prevented the module from loading in deployment configurations that do not have a src/database.py shim, resulting in an ImportError at startup. Also adds a warning log when resolve_endpoint finds no usable model (all models hidden or the list is empty), making the otherwise-silent failure visible in operator logs. The test_auth_regressions stub for src.endpoint_resolver was missing the build_models_url attribute, which caused test collection errors. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -81,13 +81,13 @@ def _auth_regressions_stubs(monkeypatch):
|
||||
resolve_endpoint=MagicMock(return_value=("", "", {})),
|
||||
normalize_base=MagicMock(),
|
||||
build_chat_url=MagicMock(),
|
||||
build_models_url=MagicMock(),
|
||||
build_headers=MagicMock(),
|
||||
)
|
||||
monkeypatch.setitem(sys.modules, "core.database", db)
|
||||
monkeypatch.setitem(sys.modules, "core.auth", auth)
|
||||
monkeypatch.setitem(sys.modules, "src.endpoint_resolver", ep)
|
||||
|
||||
|
||||
from fastapi import HTTPException
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user