fix: ensure hermes-rocketchat toolset after venv-rebuild (Core-Update-Survival Part 2)
This commit is contained in:
+53
@@ -616,6 +616,11 @@ model:
|
|||||||
providers:
|
providers:
|
||||||
ollama-cloud: {}
|
ollama-cloud: {}
|
||||||
|
|
||||||
|
# Toolset-Registrierung: hermes-rocketchat muss nach venv-Neuaufbau
|
||||||
|
# in config.yaml stehen, sonst ist der Bot stumm (keine Tools/Senden).
|
||||||
|
toolsets:
|
||||||
|
- rocketchat
|
||||||
|
|
||||||
# P2: auxiliary-Provider explizit auf ollama-cloud setzen.
|
# P2: auxiliary-Provider explizit auf ollama-cloud setzen.
|
||||||
# Verhindert Auto-Discovery-Chain (openrouter/Nous → payment errors + Timeout).
|
# Verhindert Auto-Discovery-Chain (openrouter/Nous → payment errors + Timeout).
|
||||||
auxiliary:
|
auxiliary:
|
||||||
@@ -715,6 +720,46 @@ YAML
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────
|
||||||
|
# 4b. Toolset-Registrierung sicherstellen (idempotent)
|
||||||
|
# Nach venv-Neuaufbau (pipx install) fehlt das rocketchat-Toolset in
|
||||||
|
# config.yaml → Bot ist stumm (keine Tools/Senden). Diese Funktion
|
||||||
|
# stellt sicher, dass 'rocketchat' unter toolsets: registriert ist.
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────
|
||||||
|
ensure_toolset() {
|
||||||
|
local config="$HOME/.hermes/config.yaml"
|
||||||
|
[ -f "$config" ] || { warn "config.yaml nicht gefunden — Toolset-Registrierung übersprungen"; return 0; }
|
||||||
|
|
||||||
|
# Idempotenz: Nur handeln wenn rocketchat NICHT bereits registriert ist
|
||||||
|
if grep -q '^ - rocketchat$' "$config" 2>/dev/null; then
|
||||||
|
log "Toolset 'rocketchat' bereits in config.yaml registriert"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Registriere 'rocketchat' Toolset in config.yaml..."
|
||||||
|
if $DRY_RUN; then
|
||||||
|
printf '%s[dry]%s Füge rocketchat zu toolsets: in %s hinzu\\n' "$C_YELLOW" "$C_RESET" "$config"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prüfe ob toolsets:-Sektion existiert
|
||||||
|
if grep -q '^toolsets:' "$config" 2>/dev/null; then
|
||||||
|
# toolsets: existiert — füge rocketchat als neuen Eintrag ein
|
||||||
|
# Suche die Zeile 'toolsets:' und füge danach ' - rocketchat' ein
|
||||||
|
sed -i '/^toolsets:/a\ - rocketchat' "$config"
|
||||||
|
else
|
||||||
|
# Keine toolsets:-Sektion — füge sie nach providers: ein
|
||||||
|
sed -i '/^providers:/a\\ntoolsets:\n - rocketchat' "$config"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verifikation
|
||||||
|
if grep -q '^ - rocketchat$' "$config" 2>/dev/null; then
|
||||||
|
ok "Toolset 'rocketchat' in config.yaml registriert"
|
||||||
|
else
|
||||||
|
err "FAIL: Toolset 'rocketchat' konnte nicht in config.yaml registriert werden"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# ──────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────
|
||||||
# 5. .env generieren (aus env-Variablen)
|
# 5. .env generieren (aus env-Variablen)
|
||||||
# P4: .env NICHT zwischen Maschinen kopieren (Identitätskonflikt)
|
# P4: .env NICHT zwischen Maschinen kopieren (Identitätskonflikt)
|
||||||
@@ -1505,6 +1550,11 @@ if $UPDATE_ONLY; then
|
|||||||
# ── Schritt 2: Plugin deployen ──
|
# ── Schritt 2: Plugin deployen ──
|
||||||
deploy_plugin
|
deploy_plugin
|
||||||
|
|
||||||
|
# ── Schritt 2b: Toolset-Registrierung nach venv-Neuaufbau ──
|
||||||
|
# Wenn install_hermes_agent() den venv neu gebaut hat, fehlt das
|
||||||
|
# rocketchat-Toolset in config.yaml → Bot wäre stumm.
|
||||||
|
ensure_toolset
|
||||||
|
|
||||||
# ── Schritt 3: __pycache__ NACH dem Kopieren NOCHMAL löschen ──
|
# ── Schritt 3: __pycache__ NACH dem Kopieren NOCHMAL löschen ──
|
||||||
log "Lösche __pycache__ im Ziel NACH Deployment..."
|
log "Lösche __pycache__ im Ziel NACH Deployment..."
|
||||||
if ! $DRY_RUN; then
|
if ! $DRY_RUN; then
|
||||||
@@ -1668,6 +1718,9 @@ deploy_plugin
|
|||||||
# 4. config.yaml
|
# 4. config.yaml
|
||||||
write_config_yaml
|
write_config_yaml
|
||||||
|
|
||||||
|
# 4b. Toolset-Registrierung sicherstellen (idempotent)
|
||||||
|
ensure_toolset
|
||||||
|
|
||||||
# 5. .env
|
# 5. .env
|
||||||
write_env_file
|
write_env_file
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user