Bei Auto-Route Silent Copy (Typ 1, kein Move-Request) wurde die
Notiz im Ursprungsraum gesendet, aber _CURRENT_ORIGIN_ROOM blieb auf
dem Ursprungsraum — der Agent antwortete dann fälschlich dort.
Fix: Nach der Silent Copy _CURRENT_ORIGIN_ROOM auf decision.target_room
setzen und forwarded=True, damit der Fallback in Zeile 927-928
übersprungen wird. Der Agent antwortet jetzt im Zielraum.
- initialize() now tries load() from disk first
- If load succeeds: log 'Index von Disk geladen' + wire router
- If load fails: build_index() + save() + log 'Index gebaut + gespeichert' + wire router
- Eliminates unnecessary index rebuild on every gateway restart
- All 58 tests pass
setLevel(INFO) alone was not enough — without a handler and with
propagate=True (default), logs were accepted by the root logger
(level WARNING) but silently discarded since root has no handlers.
Now matches adapter.py pattern: StreamHandler + propagate=False,
so all submodule logs (classifier, router, room_index, booster)
are visible via the shared parent logger.
Root logger defaults to WARNING (level 30) when no basicConfig is set.
adapter_integration.py only called getLogger(__name__) without setLevel,
so all INFO logs were silently filtered. adapter.py already had its own
setLevel(INFO) + handler, which is why its logs appeared.
Fix: add logger.setLevel(logging.INFO) after getLogger(__name__) at line 94.
This restores all suppressed INFO logs:
- Initializing ArchivarMessageHandler...
- FAISS Phase-1: RoomIndexManager + KeywordBooster ready
- FAISS Phase-1: Index built
- FAISS Phase-1: Router wired
- ArchivarMessageHandler ready
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)
check_room_map_completeness() und _load_room_map() verwendeten
hardcodierte Pfade (~/.hermes/hermes-agent/data/room-map.json)
statt der Konstanten ROOM_MAP_PATH/DEFAULT_MAP_PATH.
Das führte dazu, dass Unit-Tests die produktive room-map.json
überschrieben — der Mock-Patch auf ROOM_MAP_PATH griff nicht,
weil save() und reload() den hardcodierten Pfad verwendeten.
Fix:
- adapter_integration.py: 2 hardcodierte Pfade → ROOM_MAP_PATH
- room_map.py: Doppelte DEFAULT_MAP_PATH-Zuweisung entfernt
Drei Routing-Bug-Fixes basierend auf Analyse des Timeout-Falls vom 15.06.2026:
FIX 1 (KRITISCH): Timeout-Fallback auf Ursprungsraum statt Catch-All
- _llm_room_lookup() gibt jetzt (RoomEntry|None, bool) zurück
- bool=True signalisiert LLM-Aufruf-Fehler (Exception/Timeout)
- Bei LLM-Fehler: stay_in_room=True, is_catch_all=False
- Nur bei explizitem CATCH_ALL vom LLM: catch_all-Raum als Ziel
FIX 2: Keyword-Matching vor LLM-Aufruf (Embedding+Keyword-Fallback)
- Nach Embedding-Vorfilter: wenn work_order mit conf < 0.9
- find_room_by_keywords() aufrufen, bei Match direkt zurückgeben
- Verhindert unnötige LLM-Calls für klare Keyword-Matches
FIX 3: find_room_by_keywords() verbessert
- keywords_100-Matches: nicht erster Treffer, sondern Raum mit
den MEISTEN 100%-Matches gewinnt (best_100_score)
- keywords_context bleibt Fallback wenn kein 100%-Match existiert
Tests: 57/58 passed (1 pre-existing env-var failure)
Bug: DM ohne Routing nach einem Projektraum-Turn → alte
_THEMATIC_TARGET_ROOM klebt → Antwort im falschen Raum.
Fix: _THEMATIC_TARGET_ROOM.set('') zu Beginn jeder neuen Nachricht
in _process_incoming(). Der Archivar setzt sie dann neu — oder sie
bleibt leer (DM, Smalltalk, Catch-All).
Erkannt 20:21 durch Andreas: Tagesabschluss-Anfrage im DM,
Antwort landete in #Rocketchat-Plugin (vorheriger Turn).
Option C (Adapter routet Antwort automatisch um):
Priority 0 im Virtual→Real Room Translation: Wenn _THEMATIC_TARGET_ROOM
gesetzt ist und vom Ursprungsraum abweicht, geht die Antwort dorthin.
Null Core-Impact, +8 Zeilen in adapter.py, kein Prompt-Cache-Break.
Der Agent antwortet wie bisher — der Adapter lenkt um.
Flow: Agent sendet Antwort → Adapter prüft _THEMATIC_TARGET_ROOM →
gesetzt? → Zielraum. Sonst → _CURRENT_ORIGIN_ROOM (wie bisher).
Wenn der Archivar-LLM-Call timed out, erhält der Agent jetzt die
Liste aller subscribed Projekt-Räume im Prompt:
[Frage N, Timeout — Räume: #BAT-Team, #Rocketchat-Plugin, ...]
Damit kann der Agent selbstständig entscheiden, in welchen Raum
eine Frage gehört — auch ohne Archivar-Ergebnis. Erfüllt die
Auftraggeber-Vision: 'Antwortet der Archivar nach dem Timeout
nicht, entscheidet der Agent selbst, auch wenn es Token kostet.'
Bug: Der Router setzte stay_in_room=True (excluded_rooms, Meta-Fragen,
Keyword-Match auf Ursprungsraum), aber der Adapter ignorierte das Flag.
Er prüfte nur target_room != room_id → routete trotzdem.
Symptom: 'Die RC Beschreibung klingt toll' aus #Rocketchat-Plugin
löste Move-Request aus, obwohl:
- excluded_rooms → stay_in_room=True
- 'RC' matcht keywords_100 'rc' → Ziel = Ursprungsraum
Fix: Eine Zeile in der Routing-Bedingung:
and not getattr(decision, 'stay_in_room', False)
Jetzt respektiert der Adapter, wenn der Router sagt 'bleib hier'.
ArchivarMessageHandler was initialized without button_send_callback,
so every clarification request fell back to text-only ('Antworte mit
einer Zahl: 1 = Ja...'). Added _send_archivar_buttons() method that
translates Archivar button format into native Rocket.Chat Action-Buttons
with msg_in_chat_window=True. Also marks room in _rooms_with_pending_questions
so the response stays in the same room.
'::' in text (Zeile 571) klassifizierte JEDE Nachricht mit :: als
BUTTON_CLICK — z.B. Andreas' ':: Ich brauche den Wetterbericht'.
Der Agent sah die Nachricht nie → keine Antwort trotz grünem Status.
Fix: text.split('::', 1)[0].strip() != '' — erkennt nur echte
Button-Payloads (wo vor :: tatsächlich Inhalt steht wie CLARIFY:id).
':: Nachricht' → split[0] ist leer → kein Button → MessageType.TEXT.
Root Cause: Ein 3-Zeilen-ODER-Detector, der drei Payload-Formate
in einer Variable vermischt. Fragil weil Substring-Match.
- find_room_by_keywords() mit min_score Parameter (default=2)
Nur wenn best_score >= min_score → Raum returned, sonst None
→ Router fällt zu Embedding/LLM-Klassifikator durch
- verhindert Fehlrouting bei einzelnen Keyword-Treffern (plugin, etc.)
Architektur: Rainer | Implementierung: Miguel | QG: Rainer F1-F5 bestanden
Render clarify prompts with Rocket.Chat action buttons instead of
fallback text lists ('Reply with the number'). Full flow:
send_clarify():
- choices non-empty: builds RC buttons via _build_custom_buttons(),
one per choice + '✏️ Other' button
- clarify_id encoded as CLARIFY:{id}:{idx} or CLARIFY:{id}:other
- stores clarify_id→session_key in _clarify_state
- fallback to super().send_clarify() on empty choices or REST failure
_process_incoming():
- intercepts DDP messages starting with 'CLARIFY:'
- 'other' token → mark_awaiting_text() for text capture
- numeric token → resolve_gateway_clarify() with choice text
- returns immediately (no agent routing) for button clicks
__init__:
- adds self._clarify_state dict for session key mapping
The uncommitted diff from 06.06. had a bug: '::' (button response
marker) was placed in the wrong elif branch, routing it through the
Archivar instead of bypassing it.
Fixed: '::' detection moved into the top-level bypass condition alongside
is_button_response and _rooms_with_pending_questions. The dead
'elif room_type == d and is_auftrag' guard removed (redundant — DM
orders never reach this branch). Last elif promoted to else.
Der Adapter kann schon lange Buttons (send() parst [[BUTTONS:custom]] seit
Monaten). Move-Requests nutzten trotzdem nur numerische Text-Optionen.
Jetzt: _build_custom_buttons() direkt im Move-Request-Flow. Rocket.Chat
Action-Buttons [Ja, rüberkopieren] [Hier bleiben] [Generell hier bleiben]
— klickbar, keine Zahlen, kein Kontext-Verlust.
Kritischer Bug: Nach 'Hier bleiben'/'Generell hier bleiben' wurde return
aufgerufen → der Original-Auftragstext ging verloren, nur '3' erreichte
den Agenten → Agent antwortete verwirrt.
Jetzt: Originaltext aus move_req['text'] wiederherstellen, skip_archivar=True
setzen, als normale Nachricht durchreichen. Der Agent verarbeitet den Auftrag
normal weiter — der User hat nur das Routing entschieden.
Drei kritische Bugs behoben:
1. Move-Request-Prüfung VOR Archivar-Klassifikation — '3' wurde vorher als
thematische Frage ins Catch-All kopiert, jetzt wird die Antwort erkannt
2. _pending_move_requests von msg_id auf room_id umgestellt — jede Antwort
mit neuer msg_id schlug vorher fehl
3. Numerische Antworten (1/2/3) werden jetzt direkt erkannt, nicht nur
Text-Matches ('rüberkopieren'/'hier bleiben'/'generell')
The send() method in adapter.py had a structural defect where the
button-parsing, template-handling, and rest.post_message code (98 lines)
was at module level instead of inside the send() method body.
send() ended after room-resolution without a return statement, causing
it to return None. _send_with_retry() in base.py then crashed with
AttributeError: 'NoneType' object has no attribute 'success'.
This made every Rocket.Chat response silently fail — the agent
processed messages but could never deliver replies.
Fix: moved the orphaned code block back into the send() method body
where it belongs, after the room-resolution logic and before
_find_fallback_room_for_user.
DM-Aufträge werden nie geroutet. Bei thematischen Fragen: Silent Copy.
Bei Aufträgen: Buttons [Ja, rüberkopieren] [Hier bleiben] [Generell hier bleiben].
Architektur-Skizze: docs/archivar-user-flow-c.md
Button responses (`is_button_response`) are ALWAYS direct replies to an agent
question and carry a `question_id::choice` payload. Routing them through the
Archivar risked landing a one-character "A" in the catch-all room where the
agent would see it without the original question context.
Now button clicks skip `classify_and_route()` entirely and stay in whatever
room they originated from.
DocumentationStore() now uses RoomMap.fact_store_path instead of the
hardcoded ~/.hermes/.../archivar_docs default. One-line change — the
doc_store is initialized after _load_room_map() so room_map is available.
This allows per-deployment configuration: in production, fact_store_path
points to /data/Wissensdatenbank/0100 Inbox so FAKT messages land in the
Obsidian vault's inbox for StartObsidian integration.