From 3aa1c5ac7f18e7e784e3287fb2397f35f3c6646a Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Tue, 1 Sep 2026 21:44:14 +0200 Subject: [PATCH] =?UTF-8?q?fix(F98-I2):=20Cascade-Reparatur=20B17=20?= =?UTF-8?q?=E2=80=94=20FAISS=200-R=C3=A4ume=20graceful=20skip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit B17: Stufe 5 (FAISS-Rebuild) überspringt jetzt graceful bei 0 Räumen. rebuild_index.py crashte mit RoomIndexError bei leerer room-map.json. Pre-Check direkt nach _room_count-Erfassung: 0 oder '?' (Python-Crash) → ok-Meldung + skip, kein rebuild_index.py-Aufruf, kein Traceback. Branch main @ a375895. KEIN Push, KEIN Deploy. --- install.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 443435d..08680fd 100755 --- a/install.sh +++ b/install.sh @@ -2442,13 +2442,22 @@ repair_components() { # Fortschritts-Anzeige: Anzahl Räume aus room-map.json lesen local _room_count _room_count="$("$VENV_PY" -c "import json;print(len(json.load(open('$HOME/.hermes/hermes-agent/data/room-map.json')).get('rooms',[])))" 2>/dev/null || echo "?")" - log "Stufe 5: Rebuild FAISS-Index (${_room_count} Räume)..." - # rebuild_index.py erwartet cwd = Repo-Root (sys.path.insert(0, "plugin")) - # Hartes Timeout (max 300s): Embedding-Calls können bei kaltem Ollama lange dauern. - if ( cd "$script_dir" && run_timeout 300 "FAISS-Index-Rebuild" "$VENV_PY" "$rebuild_script" ); then - ok "Stufe 5: FAISS-Index neu gebaut" + # F98 B17: 0 Räume → FAISS-Index überspringen (kein Index nötig). + # rebuild_index.py crasht sonst mit RoomIndexError bei leerer + # room-map. Edge-Case _room_count="?" (Python-Crash) wird + # konservativ ebenfalls als graceful-skip behandelt, damit + # --repair nicht mit kryptischem Traceback abbricht. + if [ "$_room_count" = "0" ] || [ "$_room_count" = "?" ]; then + ok "Stufe 5: 0 Räume in room-map.json — FAISS-Index übersprungen (kein Index nötig)" else - warn "Stufe 5: TIMEOUT/Fehler beim FAISS-Rebuild — überspringe, nächste Stufe" + log "Stufe 5: Rebuild FAISS-Index (${_room_count} Räume)..." + # rebuild_index.py erwartet cwd = Repo-Root (sys.path.insert(0, "plugin")) + # Hartes Timeout (max 300s): Embedding-Calls können bei kaltem Ollama lange dauern. + if ( cd "$script_dir" && run_timeout 300 "FAISS-Index-Rebuild" "$VENV_PY" "$rebuild_script" ); then + ok "Stufe 5: FAISS-Index neu gebaut" + else + warn "Stufe 5: TIMEOUT/Fehler beim FAISS-Rebuild — überspringe, nächste Stufe" + fi fi else printf '%s[dry]%s (cd %s && %s %s) (max 300s)\n' "$C_YELLOW" "$C_RESET" "$script_dir" "$VENV_PY" "$rebuild_script"