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:
Bernd (Hermes)
2026-07-14 19:31:55 +02:00
parent 7822c11336
commit 8853a1d9e3
4 changed files with 303 additions and 14 deletions
+7 -3
View File
@@ -147,7 +147,10 @@ LLM_CONFIG = {
"enabled": os.getenv("ARCHIVAR_ENABLE_LLM", "").strip().lower() in ("1", "true", "yes"),
"model": "qwen2.5:7b",
"timeout": 30.0, # Iterative Optimierung: Start 30s (19.06.2026)
"base_url": os.getenv("OLLAMA_BASE_URL", "http://localhost:11434"),
"base_url": os.getenv(
"ARCHIVAR_LLM_BASE_URL",
os.getenv("OLLAMA_BASE_URL", "http://localhost:11434")
),
"temperature": 0.0,
"max_tokens": 30, # Raum-ID = 24 chars + Puffer
}
@@ -209,8 +212,9 @@ ARCHIVAR_STUFE_LOG = (
MOVE_REQUEST_TEMPLATE: dict = {
"text": "Soll ich diese Nachricht nach {target_name} kopieren?",
"actions": [
{"text": "✅Ja", "type": "confirm_move"},
{"text": "📍Hier", "type": "stay_here"},
{"text": "1️⃣ Rüber", "type": "confirm_move"},
{"text": "2️⃣ Generell hier", "type": "stay_here"},
{"text": "3️⃣ Nur diesmal", "type": "stay_once"},
],
}