BUGFIX: FAISS Phase-1 TypeError float+str in adapter_integration.py:292

Root cause: RoomIndexManager.stats() returns a dict with mixed types
(bool, int, float, str). sum() iterated over all values and crashed
when hitting built_at_iso (str) after built_at (float).

Fix: Replace stats() call with direct .size and .room_ids properties.
Also commit FAISS Phase-1 files (booster.py, room_index.py, seed_data.py)
that were deployed to Gateway but not yet in repo.

Tests: 58 passed (0 failures)
This commit is contained in:
Bernd (Hermes)
2026-06-16 20:31:57 +02:00
parent 43d14b2d58
commit 03d3bb44df
4 changed files with 933 additions and 3 deletions
+4 -3
View File
@@ -286,11 +286,12 @@ class ArchivarMessageHandler:
if self._room_index is not None and self._booster is not None:
try:
self._room_index.build_index()
index_stats = self._room_index.stats()
room_count = self._room_index.size
room_ids = self._room_index.room_ids
logger.info(
"FAISS Phase-1: Index gebaut — %d Vektoren in %d Räumen: %s",
sum(index_stats.values()), len(index_stats),
", ".join(f"{rid[:12]}…={n}" for rid, n in index_stats.items())
room_count, room_count,
", ".join(f"{rid[:12]}…" for rid in room_ids)
)
# Router mit FAISS-Objekten neu erstellen
self._router = BidirectionalRouter(