TEIL 1: _GC_TIMEOUT_S variable gemacht
- Statt harter 30.0-Konstante: Env-Variable PRESENCE_GC_TIMEOUT_S mit Default 1800.0s (30 Min)
- os.getenv('PRESENCE_GC_TIMEOUT_S', '1800') -> float in __init__
- GC_TIMEOUT_DEFAULT_S = 1800.0 als Klassenkonstante dokumentiert
TEIL 2: Progress-Refresh bei Core-Aktivitaet
- refresh_chat_profile_timestamp() in PresenceEngine hinzugefuegt
- Setzt self._counter_timestamps['chat_profile'] = time.time() unter transition_lock
- Im adapter.py send(): bei jeder ausgehenden Nachricht mit '⏳' wird der Timestamp refreshed
- Optional-additiv: wenn Refresh nicht feuert, greift 1800s-Cap als Notbremse
TEIL 3: Doku
- GC-Block-Kommentar in _drift_correction() auf P-041a erweitert
- install.sh: PRESENCE_GC_TIMEOUT_S env-Variable dokumentiert (Default 1800s)
Pitfalls: P-039, P-041, P-041a
_verify_since wurde bisher NACH dem Gateway-Neustart (und nach sleep 20)
gesetzt, wodurch journalctl --since die Initialisierungs-Logs
(PresenceEngine, Archivar, Connected) nicht fand — die erscheinen in den
ersten 6-10s nach Gateway-Start.
Fix: _verify_since VOR restart_gateway setzen, alte redundante Zuweisung
in der Verifikations-Sektion entfernt.
Post-Deployment-Verifikation im --update-only Block:
- Sleep von 8s auf 12s erhöht (Gateway braucht ~8-10s für Archivar/Connected)
- Retry-Schleife: bis zu 3 Versuche im Abstand von 5s (max 22s total)
- journalctl --since mit präzisem Zeitstempel (date) statt '2 minutes ago'
- --no-pager Flag für zuverlässige Ausgabe
- Jede Prüfung gibt Treffer-Anzahl aus (nicht nur 'NICHT gefunden')
- Erst nach 3 vergeblichen Versuchen -> die() mit Fehler
Tests: 7 neue Testfälle für retry-loop, timestamp, --no-pager, sleep 12,
hit counts, retry-wait-message. Alle 21 Tests grün.
B1 (BLOCKER): pipx installiert hermes-agent jetzt zwingend mit --python python3.13.
- python3.13 wird via apt installiert falls nicht vorhanden
- Bestehende pipx-venv mit falscher Python-Version wird erkannt und neu installiert
- Verifikation prüft pipx-venv Python-Version auf exakt 3.13
B2 (BLOCKER): Alle Verifikations-Checks nutzen jetzt $VENV_PY (pipx-venv Python)
statt system-python3. YAML-Syntax-Check in write_config_yaml() nutzt die statt warn.
Alle Checks in verify_installation() setzen fail=1 und exit 1 bei Fehlern.
B3 (BLOCKER): set -euo pipefail war bereits vorhanden. Idempotenz durch
pipx-Reinstall bei falscher Python-Version ergänzt.
R5: INSTALL.md um 'Wichtige Hinweise' ergänzt — journalctl zeigt Secrets,
Logs nicht ungefiltert teilen.
R6: providers: {} → providers:\n ollama-cloud: {} in install.sh und
templates/config.yaml. Verhindert Auto-Discovery-Risiko beim ersten Modell-Aufruf.
P0-1: install.sh schreibt ARCHIVAR_ENABLE_LLM=true in rocketchat.env bei MULTIROOM=true
P0-2: Dead-Code adapter.py:1359-1435 entfernt (Silent-Copy-Pfad im v6-Flow unerreichbar)
P0-3: should_stay_in_room() gibt jetzt 'origin_first'/'sticky'/None statt True/False/None
P1-1: Reconnect-Onboarding prüft jetzt auf neue Räume statt immer zu skippen
P1-2: _set_catch_all() baut FAISS-Index nach Catch-All-Wechsel neu
P1-3: stay_tracker in ArchivarState persistiert (archivar_state.json)
P1-4: onboarding_state in ArchivarState persistiert (archivar_state.json)
Bug 3 — Onboarding-Buttons als Text statt interactive:
- adapter.py: Neue Methode _get_build_custom_buttons() mit lokalem Fallback
der korrekte Rocket.Chat Button-Dicts baut, wenn das rocketchat-Modul
nicht in sys.modules ist (Race-Condition beim Import)
- _start_onboarding() nutzt jetzt _get_build_custom_buttons() statt
des Modul-Level-Fallbacks _build_custom_buttons (der [] liefern kann)
- _onboarding_next_room() ebenfalls auf _get_build_custom_buttons() umgestellt
- Operator-DM-Erkennung nicht mehr hardcoded auf 'andreas' — nimmt ersten DM
- Selbsterklärende Onboarding-Nachricht mit Emoji und Kontext
Bug 4 — Move-Request-Schleife, Sticky greift nicht:
- Option 2 (Generell hier): Persistiert jetzt in ArchivarState
(set_room_state(room_id, 'never_route', username)) — überlebt Neustarts
- Option 3 (Hier bleiben): Stay-Counter — nach 3x Stay in 10 Min
wird der Raum automatisch auf never_route promoted
- _sticky_rooms (in-memory) bleibt als schneller Cache erhalten
Bug 5 — Falsche room-map.json wird geladen:
- install.sh: Alle 3 room-map.json-Deploy-Stellen prüfen jetzt, ob die
existierende Datei 0 Räume enthält (leeres Template) → dann neu deployen
- Verhindert dass das leere Template nach Erstinstallation für immer bleibt
B9 — Auto-Onboarding ohne Vorkenntnisse:
- connect(): Trigger prüft jetzt: MULTIROOM_AGENT=true + Räume ohne Map-Eintrag
+ Ausnahme: Nur DM → kein Onboarding
- Zusätzlich: Wenn room-map.json 0 Räume hat → Onboarding für ALLE non-DM-Räume
- _finish_onboarding(): FAISS-Index wird nach Onboarding neu gebaut + gespeichert
- _is_user_operator(): Nicht mehr hardcoded — erster DM-User wird Operator
Syntax-Check: Alle .py (20 Dateien) + install.sh → OK
D1 (RELEASE-BLOCKIEREND): Guard 2.5 — LLM schlägt excluded room vor
router.py: Nach Guard 2 (Catch-All) prüft Guard 2.5 ob LLM-Raum
excluded ist → stay_in_room. Verhindert Move-Request in excluded room.
D2 (RELEASE-BLOCKIEREND): DMs können in Projekträume geroutet werden
router.py: Schritt 0 DM-Guard VOR allem anderen. origin_room_id leer
(DM) → sofort stay_in_room. DMs nie vom Routing betroffen.
D3 (DRINGEND): Self-Match-Schutz in Schritt 3, 3.5, 4.5
router.py: Keyword-Match (Schritt 3), FAISS auto-route (Schritt 3.5),
Keyword-Match vor LLM (Schritt 4.5) prüfen alle auf
matched_room.room_id == origin_room_id → stay_in_room.
D4 (DRINGEND): install.sh base_url-Löschung zu aggressiv
install.sh: base_url mit openrouter nur löschen wenn
_RC_PROVIDER == ollama-cloud. Bei explizitem openrouter bleibt sie.
FIX 1: numpy/faiss-cpu pip install in venv nach Plugin-Deployment
in allen drei Pfaden (perform_update, perform_update_only,
main interactive). Archivar braucht diese Packages für
FAISS Phase-1 RoomIndex — ohne sie crasht der Import.
FIX 2: Zirkelimport adapter.py ↔ archivar/adapter_integration.py
gebrochen. _room_context/_room_context_lock werden jetzt
lazy innerhalb handle_feedback_response() importiert.
FIX 3: Minimale room-map.json (version=1, rooms={}) wird als
Template bereitgestellt und bei Clean-Install ins
Datenverzeichnis kopiert. RC-Skill-Onboarding erstellt
die vollständige, maschinen-spezifische Version.
FIX 4: Archivar-Symlink liegt bereits korrekt im HERMES_DIR
(Commit 5c8026c). Keine Änderung nötig.
Gateway startete nach Reboot nicht automatisch, weil install.sh nur
stop+start ausführte, aber den Service nie enabled hat.
Fix: systemctl --user enable hermes-gateway in perform_update(),
perform_update_only() und main script — jeweils nach reset-failed,
vor stop. enable ist idempotent, daher bei jedem Durchlauf sicher.
Root Cause: hermes gateway install installiert die Unit, aber ob es
sie enabled ist unklar. Explizites enable stellt Autostart sicher.
Review: Rainer (Session 20260620_155910_6559a0)
Patch: Don (Session 20260620_155930_3dce08)
Guard 1 — Syntax-Check VOR Deployment:
python3 -m py_compile für alle .py-Dateien im plugin/-Ordner.
Bei SyntaxError → Abbruch mit Meldung.
Guard 2 — Vollständigkeits-Check NACH Deployment:
diff zwischen plugin/-Ordner und Zielpfad.
Fehlende Dateien → Abbruch mit Liste.
Guard 3 — Pycache-Löschung NACH Deployment:
find -name '__pycache__' -delete + find -name '*.pyc' -delete.
Verhindert Stale-Bytecode-Falle.
Alle 3 Guards in deploy_plugin_files() integriert.
Problem: Journal-Grep suchte nur nach 'rocketchat.*connected' —
wenn Telegram die einzige Plattform war (Discovery-Bug), galt
die Verifikation trotzdem als erfolgreich.
Fix: python3 liest gateway_state.json und prüft BEIDE Plattformen:
rocketchat=connected UND telegram=connected. Erst dann gilt
der Gateway-Start als erfolgreich.
Robuster als Journal-Grep: state.json ist die Ground Truth,
nicht Log-Zeilen die fehlen können.
ROOT CAUSE: install.sh --update-only blindly deployed room-map.json
from the repo (containing 'GENERAL' as catch_all) to the production
/home/bernd/.hermes/data/ directory, overwriting the machine-specific map.
FIXES (3 changes):
1. REMOVED room-map.json from repo + added to .gitignore
This file is machine-specific data, not source code.
2. REMOVED room-map.json deploy from install.sh (both paths):
- Normal install block (section 3.5)
- --update-only emergency deploy (section 3.5)
Replaced with comment: 'MACHINE-SPECIFIC — created by RC-Skill onboarding'
3. FIX adapter.py: is_unrouteable guard on ContextVar routing
Before: ContextVar set to target_room even when unrouteable
Result: 'Ich antworte im Zielraum.' note appeared, but Hermes
couldn't deliver to unsubscribed room — answer lost silently.
After: Forward block checks not getattr(decision, 'is_unrouteable', False)
If unrouteable → stays in origin room, answers there normally.
PRODUCTION: Correct room-map.json deployed with 4 project rooms
+ DM catch_all on .101. Excluded rooms: multi-agent DM, testbot DM.