fix: V8.1 Routing-Engine — 7 Root Causes (Auto-Route, Sticky, Echo, Kontext-Ring, LLM-URL, FAISS, Buttons)
P1: 100%-Keyword-Route sendet Antwort in Zielraum (echtes Routing)
- adapter.py:1603-1645: Auto-Route-Block vor _CURRENT_ORIGIN_ROOM
- Bei move_request_sent=False + target_room != room_id → dispatch in Zielraum
- Nachricht wird in Zielraum kopiert, Agent antwortet dort
P2: Temporäres Sticky (30 Min) bei confirm_move
- adapter.py:625: _session_room_preferences Dict
- adapter.py:1414-1428: Sticky bei confirm_move gesetzt
- adapter.py:1557-1597: Session-Sticky-Check vor Archivar (Auto-Route)
- adapter.py:1638-1645: Sticky auch bei Auto-Route gesetzt
P3: Echtes Move (Original löschen) statt Copy+Breadcrumb
- adapter.py:1414-1420: Kein Copy mehr bei confirm_move
- Nur Breadcrumb "Wir sind rübergewechselt → #Zielraum" im Ursprungsraum
P4: MultiRoomContext-Ring — raum-übergreifender Konversations-Kontext
- Neu: archivar/multiroom_context.py (Ring-Buffer, 10 Einträge)
- adapter.py:1293-1299: Ring-Update bei jeder User-Nachricht
- adapter.py:1752-1767: Ring-Summary in System-Prompt injiziert
P5: LLM-Router URL — ARCHIVAR_LLM_BASE_URL statt OLLAMA_BASE_URL
- config.py:150-153: Neue Env-Var ARCHIVAR_LLM_BASE_URL
- OLLAMA_BASE_URL als Legacy-Fallback
P6: FAISS is_stale() — Member-Set-Check zusätzlich zu Version
- room_index.py:540-590: Prüft set(map_rooms) == set(index_rooms)
- Bei Mismatch → rebuild mit Logging
P7: Move-Request-Template auf 3 Buttons
- config.py:209-215: 1️⃣ Rüber, 2️⃣ Generell hier, 3️⃣ Nur diesmal
- stay_once fällt in else-Branch (adapter.py:1447)
Verifikation: 345/346 archivar tests passed (1 pre-existing env fail)
This commit is contained in:
@@ -538,7 +538,7 @@ class RoomIndexManager:
|
||||
return True
|
||||
|
||||
def is_stale(self, room_map_version: Optional[int] = None) -> bool:
|
||||
"""Prüft ob der Index veraltet ist (RoomMap-Version neuer).
|
||||
"""Prüft ob der Index veraltet ist (RoomMap-Version neuer ODER Member-Set abweichend).
|
||||
|
||||
Args:
|
||||
room_map_version: Aktuelle Version der RoomMap. Default:
|
||||
@@ -550,11 +550,45 @@ class RoomIndexManager:
|
||||
if not self.is_built:
|
||||
return True
|
||||
|
||||
# Check 1: Version mismatch
|
||||
current_version = (
|
||||
room_map_version if room_map_version is not None
|
||||
else self._room_map.version
|
||||
)
|
||||
return current_version > self._version
|
||||
if current_version > self._version:
|
||||
logger.info(
|
||||
"RoomIndex stale: version mismatch (index=%d, map=%d)",
|
||||
self._version, current_version,
|
||||
)
|
||||
return True
|
||||
|
||||
# Check 2: Member-Set mismatch (rooms added/removed without version bump)
|
||||
map_room_ids = set(
|
||||
rid for rid, entry in self._room_map.rooms.items()
|
||||
if not entry.catch_all
|
||||
)
|
||||
index_room_ids = set(self._room_ids)
|
||||
if map_room_ids != index_room_ids:
|
||||
missing_from_index = map_room_ids - index_room_ids
|
||||
extra_in_index = index_room_ids - map_room_ids
|
||||
logger.info(
|
||||
"RoomIndex stale: member-set mismatch — "
|
||||
"missing_from_index=%d, extra_in_index=%d",
|
||||
len(missing_from_index), len(extra_in_index),
|
||||
)
|
||||
if missing_from_index:
|
||||
logger.info(
|
||||
" Rooms NOT in index: %s",
|
||||
", ".join(f"{rid[:12]}…" for rid in sorted(missing_from_index)[:5]),
|
||||
)
|
||||
if extra_in_index:
|
||||
logger.info(
|
||||
" Rooms NOT in map (stale): %s",
|
||||
", ".join(f"{rid[:12]}…" for rid in sorted(extra_in_index)[:5]),
|
||||
)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
# ── Internal Helpers ────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user