Commit Graph

39 Commits

Author SHA1 Message Date
Bernd (Hermes) 1157c73d65 fix(install.sh): ssh-keyscan + SSH→HTTP Fallback + Endlosschleife-Guard
- U1: ssh-keyscan -p 222 192.168.180.47 vor git clone (frische VM)
- U2: git clone SSH→HTTP Fallback (kein SSH-Key auf frischer VM)
- Rainer-Bug: Endlosschleife bei .git ohne plugin/ → fatal Guard
- chmod 700 ~/.ssh nach mkdir (SSH strict-mode)
- ssh-keyscan Argumentreihenfolge: -p PORT HOST

Rainer-Quality-Loop: freigegeben (2 Iterationen)
2026-07-12 11:23:58 +02:00
Bernd (Hermes) 5a9cf5f160 fix: Rainer-Quality-Loop — 4 Fixes (2 release-blockierend, 2 dringend)
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.
2026-07-09 17:41:01 +02:00
Bernd (Hermes) 1ade5549b3 fix(templates): Platzhalter statt harter Konfigurationsdaten — keine .101-Leaks 2026-06-23 10:22:57 +02:00
Bernd (Hermes) 9488f44d88 fix(install.sh): MULTIROOM_AGENT in Drop-in für true UND false — überlebt gateway install 2026-06-23 08:31:27 +02:00
Bernd (Hermes) 85713a7e29 fix(install.sh): MULTIROOM_AGENT in Drop-in statt Haupt-Unit — überlebt gateway install 2026-06-23 08:30:29 +02:00
Bernd (Hermes) 4f9054fea1 fix(install.sh): MULTIROOM_AGENT conditional — numpy/faiss, room-map.json, systemd-Unit Environment=, OLLAMA_API_KEY 2026-06-23 07:01:15 +02:00
Bernd (Hermes) 9be9e616d1 fix(install.sh): deploy to plugins/rocketchat/ not plugins/platforms/rocketchat/ 2026-06-22 17:40:25 +02:00
Bernd (Hermes) 6f47885b1c fix(install.sh): numpy, circular import, room-map.json, archivar symlink in hermes root
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.
2026-06-22 12:47:50 +02:00
Bernd (Hermes) 868ee153ac docs(install.sh): add resource warning before multi-room prompt 2026-06-22 11:46:55 +02:00
Bernd (Hermes) 40563864ac fix(install.sh): correct systemd unit + MULTIROOM_AGENT interactive prompt (default N) 2026-06-22 11:45:04 +02:00
Bernd (Hermes) 5c8026c0f0 fix(install.sh): create archivar symlink for core plugin loader 2026-06-22 11:21:23 +02:00
Bernd (Hermes) 5abab32d0f fix(install.sh): systemctl --user enable hermes-gateway in allen drei Start-Pfaden
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)
2026-06-20 16:00:10 +02:00
Bernd (Hermes) 48fb292fe0 fix(install.sh): Deployment-Pipeline mit 3 Guards gehärtet
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.
2026-06-14 19:40:17 +02:00
Hermes Agent 53ffcf9b4d fix(install.sh): Verifikation prüft gateway_state.json statt Journal-Grep
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.
2026-06-12 17:30:23 +02:00
Hermes Agent 213831757a fix(install.sh): State-Cleanup vor Gateway-Restart in allen drei Pfaden
Problem: systemctl restart hing in 'deactivating' (Gateway-Drain bis 60s).
Der neue Prozess startete nie — deployter Code war nicht aktiv.

Fix in allen drei Restart-Pfaden (--update-only, --update, Erstinstallation):
1. State-Cleanup: gateway_state.json + .lock + .tmp löschen
   → verhindert Discovery-Bug (Platform-Verlust nach SIGTERM)
   → verhindert Auto-Resume-Crash-Loop
2. reset-failed: systemd-Failure-Counter zurücksetzen
3. stop + wait (bis 60s): Gateway sauber stoppen vor Neustart
4. start: Gateway frisch starten (statt restart)

Verify-Timeout von 15s auf 60s erhöht (Gateway braucht länger nach Cleanup).
Verify-Pattern erweitert: 'rocketchat.*connected' + '✓ rocketchat connected'
2026-06-12 08:33:21 +02:00
Hermes Agent 4d35669174 fix: prevent room-map.json overwrite + is_unrouteable handler
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.
2026-06-06 18:53:11 +02:00
Hermes Agent 024a173c8d Fix Archivar forward note bug: Use rest.post_message() instead of self.send() to ensure note appears in origin room 2026-06-06 09:11:41 +02:00
Hermes Agent be917afcbd feat(install): add --update-only emergency deploy mode
Adds '--update-only' flag for crisis deployment — no questions,
no Ollama, no config provisioning. Just find hermes dir, deploy
all plugin files, clear __pycache__, restart gateway, verify.

Flow:
  1. find_hermes_dir() → resolve correct path (6-priority cascade)
  2. create_backup() → tar.gz safety net
  3. cp plugin/ → $HERMES_DIR/plugins/platforms/rocketchat/
  4. rm -rf __pycache__
  5. systemctl restart hermes-gateway
  6. journalctl grep verification (15s timeout)

Use case: Gateway loses plugin discovery after clean shutdown.
Instead of manual cp + restart, one command: ./install.sh --update-only

Language strings added for DE + EN. Help text updated.
2026-06-05 18:00:36 +02:00
Hermes Agent b5a43223ac fix: make install.sh executable (chmod +x) 2026-06-05 05:40:39 +02:00
Hermes Agent f509710193 Fix find_hermes_dir(): trailing-space in Prio 2 sed, multi-PID in Prio 3 pgrep 2026-06-04 08:51:20 +02:00
Hermes Agent c2ded4ab9a Fix find_hermes_dir(): set +e vor jedem Subshell-Block um set -euo pipefail zu überleben 2026-06-04 08:48:51 +02:00
Hermes Agent 4af89ce13e Fix find_hermes_dir() Prio 5: check hermes-agent subdir when using get_hermes_home() 2026-06-04 08:44:49 +02:00
Hermes Agent 7364ae3333 Fix function order: move find_hermes_dir() before perform_update() to ensure proper definition before use 2026-06-04 08:42:10 +02:00
Hermes Agent 4ef07a14b9 fix: zielsichere HERMES_DIR-Ermittlung mit Prioritätenkaskade (Rainer/P1-P6) 2026-06-04 08:38:10 +02:00
Hermes Agent 7eac6b7dba Fix: replace find|while pipe with process substitution in perform_update() and main script
This fixes the issue where cp and mkdir in the while loop were running in a subshell
due to pipe usage, preventing proper error propagation with 'set -euo pipefail'.
Using process substitution ensures the while loop runs in the main process.
2026-06-04 08:04:03 +02:00
Hermes Agent c4775ca99e Fix update flow: git pull statt checkout, Plugin-Dateien direkt kopieren, kein ./install.sh Selbstaufruf 2026-06-04 06:25:30 +02:00
Hermes Agent d7ce3afcd0 Bugfixes für install.sh: 1) Zustandsvariable statt Exit-Code für Updates, 2) Stash-Mechanismus für git checkout mit lokalen Änderungen 2026-06-04 06:10:42 +02:00
Hermes Agent d01eded6ff fix: drei /API-KEY-Bugs — install.sh jetzt komplett productionsicher
Bug #12: /usr/bin/bash-Expansion im Passwort verhindert — cat <<'EOF' (single-quoted delimiter)
         + Platzhalter-Ersetzung via python3 (sed expandiert hBcZeichen in double quotes)
Bug #10: OLLAMA_BASE_URL aus rocketchat.env entfernt — überschreibt sonst Cloud-Provider-URL
Bug #11: OLLAMA_API_KEY via env var setzbar (OLLAMA_API_KEY=...) statt hartem Platzhalter
2026-06-03 17:37:13 +02:00
Hermes Agent 13a87fb233 fix: template now uses ollama-cloud as built-in provider + home_channel placeholders
Root cause: 'ollama-cloud' is a built-in Hermes provider. Putting it under
custom_providers with api_key_env broke key resolution. Built-in providers
use their own env-var conventions (OLLAMA_API_KEY, not HERMES_API_KEY).

Changes:
- template: model.provider=ollama-cloud, base_url=ollama.com/v1 (no custom_providers)
- template: gateway.platforms.rocketchat.home_channel with PLACEHOLDER vars
- install.sh: sed-replace placeholders with actual RC_URL/RC_HOME_CHANNEL
- template: .env now uses OLLAMA_API_KEY (what ollama-cloud actually reads)
- Bug #11 (export prefix in rocketchat.env) still needs push
2026-06-03 14:05:22 +02:00
Hermes Agent d6b30d8d87 fix: remove export prefix from rocketchat.env (systemd compatibility)
EnvironmentFile in systemd drop-ins parses KEY=VALUE only.
'export' prefix caused systemd to silently ignore all vars,
leaving the Gateway with 'No messaging platforms enabled'.

Bug found during .45 test run #2.
2026-06-03 12:31:15 +02:00
Hermes Agent f54f90be5b fix: provision config.yaml/.env + systemd EnvironmentFile drop-in
Fixes #9 (custom_providers missing — fresh installs had no config.yaml/.env,
so gateway had no provider to connect to) and #10 (systemd unit had no
EnvironmentFile, so gateway couldn't read rocketchat.env/.env → crash-loop).

Templates provisioned on first install only (no overwrites):
- templates/config.yaml: minimal working config with ollama-cloud provider
- templates/.env: API key placeholder
- templates/hermes-gateway-env.conf: systemd drop-in wiring rocketchat.env + .env
2026-06-03 12:24:08 +02:00
Hermes Agent e3dc543af5 fix: install.sh line 318 — don't zero out env vars before --non-interactive reads them
The local initialization RC_URL="" on line 318 was destroying
environment variables before the non-interactive block (line 330+)
could read them via ${RC_URL:-${ROCKETCHAT_BASE_URL:-}}.

Fix: use ${RC_URL:-} to preserve values already set in the environment.
2026-06-03 10:14:07 +02:00
Hermes Agent 88b7149dd1 feat: Archivar delivery + install.sh v2.2 — full function set
- Add archivar/ submodule to plugin/ (5 files, relative imports)
- Update adapter.py with relative Archivar import from .archivar.adapter_integration
- install.sh: fix --non-interactive env-var reading (Z.316-318, Bug #7)
- install.sh: recursive file copy (was 4 flat files, now entire plugin/ tree incl. submodules)
- install.sh: Ollama presence check + nomic-embed-text pull
- install.sh: write OLLAMA_BASE_URL to rocketchat.env
- install.sh: add new message keys (collama_check, nomic_pull, nomic_ok, nomic_fail, copied)

Closes: Archivar delivery gap (2026-06-03)
Reviewed-by: Bernd (Advisor)
2026-06-03 10:12:47 +02:00
Hermes Agent 5d65789295 Fix install.sh: Replace with corrected version that resolves update check issues 2026-06-01 08:15:46 +02:00
Bernd fc13a9ee87 v2.0: Gateway-Plugin-Architektur + interaktiver bilingualer install.sh
- Legacy-Standalone-Daemon entfernt (__init__.py, adapter.py, _merge_config.py, uninstall.sh)
- Plugin-Dateien in plugin/ strukturiert (von produktiver Susi-Instanz)
- Neuer install.sh: --lang en/de, --help, --non-interactive, Bot Username Prompt, Re-Install-Erkennung
- tools.py: Rocket.Chat REST-Tools fur Rooms, Users, DMs, Send
- BasePlatformAdapter-Vererbung, DDP-added-Events, case-insensitive Filter
2026-05-11 06:56:16 +02:00
Bernd (Hermes) e6efe55edc feat: install.sh schreibt ALLE Einstellungen in config.yaml; Button-Doku korrigiert (Desktop ~5-7 chars, keine Underscores, online statt away); adapter+init auf Produktionsstand 2026-05-10 07:51:00 +02:00
Bernd (Hermes Agent) a7db2942f6 feat: add uninstall.sh with dry-run, --help, full cleanup; update install.sh + COMMUNITY_POST.md 2026-05-05 21:07:11 +02:00
Bernd (Hermes Agent) c4c1f344ce feat: add --dry-run mode to install.sh + update Gitea description 2026-05-05 18:45:38 +02:00
Bernd (Hermes Agent) b6b3469c21 feat: add install.sh — interactive setup for beginners with emoji feedback + README overhaul 2026-05-05 17:46:06 +02:00