File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,12 @@ def _check_redis(config: AppConfig) -> List[str]:
5050 try :
5151 client .ping ()
5252 except Exception as exc : # pragma: no cover - runtime dependent
53- raise HealthCheckError (f"Redis connectivity check failed: { exc } " ) from exc
53+ LOGGER .warning (
54+ "Redis connectivity check failed (%s); using in-memory fallback." , exc
55+ )
56+ return [
57+ "redis unavailable; using in-memory working memory fallback." ,
58+ ]
5459 return []
5560
5661
@@ -69,7 +74,13 @@ def _check_chromadb(config: AppConfig) -> List[str]:
6974 client = cast (Any , chromadb_module ).PersistentClient (path = str (persist_dir ))
7075 client .list_collections ()
7176 except Exception as exc : # pragma: no cover - runtime dependent
72- raise HealthCheckError (f"ChromaDB availability check failed: { exc } " ) from exc
77+ LOGGER .warning (
78+ "ChromaDB availability check failed (%s); using in-memory memory store." ,
79+ exc ,
80+ )
81+ return [
82+ "chromadb unavailable; in-memory persistence activated." ,
83+ ]
7384 return []
7485
7586
Original file line number Diff line number Diff line change @@ -385,6 +385,11 @@ def __init__(self, config: AppConfig) -> None:
385385
386386 self ._embedding_fn = self ._build_embedding_function (config )
387387 self ._supports_vector_query = self ._embedding_fn is not None
388+ if not self ._supports_vector_query :
389+ self ._logger .warning (
390+ "Chroma embedding function unavailable; storing memory in-process."
391+ )
392+ return
388393
389394 try : # pragma: no cover - needs chromadb runtime
390395 self ._client = chromadb_module .PersistentClient (
Original file line number Diff line number Diff line change 1313import pytest
1414
1515from config import settings
16- from core .exceptions import HealthCheckError
1716from core .health import run_startup_checks
1817
1918
@@ -70,14 +69,15 @@ def test_health_checks_with_stubbed_dependencies(monkeypatch: pytest.MonkeyPatch
7069 assert warnings == []
7170
7271
73- def test_health_checks_raise_on_redis_failure (monkeypatch : pytest .MonkeyPatch , tmp_path : Path ) -> None :
72+ def test_health_checks_warn_on_redis_failure (monkeypatch : pytest .MonkeyPatch , tmp_path : Path ) -> None :
7473 config = _load_config (tmp_path )
7574 config .memory .chromadb .persist_directory = str (tmp_path / "chroma" )
7675
7776 _install_stub_modules (monkeypatch , tmp_path , redis_ping_ok = False )
7877
79- with pytest .raises (HealthCheckError ):
80- run_startup_checks (config )
78+ warnings = run_startup_checks (config )
79+ assert warnings
80+ assert any ("redis unavailable" in warning for warning in warnings )
8181
8282
8383def test_health_checks_warn_when_standard_embedding_missing (monkeypatch : pytest .MonkeyPatch , tmp_path : Path ) -> None :
You can’t perform that action at this time.
0 commit comments