Hermes-Update-Playbook: doctor im Job, Config-Drift-Scan + Tool-/Voice-Smoke im Postcheck, LLM-Release-Notes im Modal
- Update-Job: nach 'hermes update' laeuft 'hermes doctor' (Job rot bei Fehlern) - hermes-postcheck.sh: Journal-Scan auf Unknown/deprecated/defaulting (Lehre aus v0.18: approvals.mode 'auto' wurde still ungueltig -> alle Tools in pending_approval), Tool-Smoke (echo via Agent, erkennt pending_approval), Voice-Smoke (/api/voice/chat) - Update-Modal: die Box fasst anstehende Hermes-Commits selbst zusammen (fast-Modell, no-think, gecacht auf neuesten Hash) — Breaking Changes zuerst Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -359,8 +359,44 @@ def swap_update_details() -> dict:
|
||||
return info
|
||||
|
||||
|
||||
# LLM-Zusammenfassung der anstehenden Hermes-Commits (die Box liest ihre Release-Notes selbst).
|
||||
# Gecacht auf den neuesten Commit-Hash — das Modal darf beliebig oft geöffnet werden.
|
||||
_relnotes_cache: dict = {"key": "", "summary": ""}
|
||||
|
||||
|
||||
def _summarize_hermes_commits(commits: list[dict]) -> str:
|
||||
key = commits[0]["hash"] if commits else ""
|
||||
if not key:
|
||||
return ""
|
||||
if _relnotes_cache["key"] == key and _relnotes_cache["summary"]:
|
||||
return _relnotes_cache["summary"]
|
||||
from config import LLAMA_SWAP_URL
|
||||
subjects = "\n".join(f"- {c['subject']}" for c in commits[:100])
|
||||
prompt = (
|
||||
"Du bist der Update-Berater einer lokalen AI-Box (Hermes-Agent auf Strix Halo; genutzt werden: "
|
||||
"api_server/Gateway, memory-provider-Plugin 'mc2-memory', terminal-/web-Tools, approvals, cron). "
|
||||
"Hier die Commit-Titel des anstehenden Hermes-Updates:\n\n" + subjects + "\n\n"
|
||||
"Fasse auf DEUTSCH in maximal 6 Stichpunkten zusammen: (1) Breaking Changes oder geänderte/"
|
||||
"entfernte Config-Schlüssel (WICHTIGSTES zuerst, explizit warnen), (2) was unser Setup betrifft, "
|
||||
"(3) welche neuen Features sich für uns lohnen. Keine Einleitung, nur die Punkte."
|
||||
)
|
||||
try:
|
||||
r = httpx.post(f"{LLAMA_SWAP_URL}/v1/chat/completions", timeout=90.0, json={
|
||||
"model": "fast", "max_tokens": 380, "temperature": 0.2,
|
||||
"chat_template_kwargs": {"enable_thinking": False},
|
||||
"messages": [{"role": "user", "content": prompt}],
|
||||
})
|
||||
r.raise_for_status()
|
||||
summary = ((r.json().get("choices") or [{}])[0].get("message", {}).get("content") or "").strip()
|
||||
if summary:
|
||||
_relnotes_cache.update(key=key, summary=summary)
|
||||
return summary
|
||||
except Exception as exc: # noqa: BLE001 — Zusammenfassung ist Komfort, nie Blocker
|
||||
return f"(Zusammenfassung nicht verfügbar: {exc})"
|
||||
|
||||
|
||||
def hermes_update_details() -> dict:
|
||||
"""Commits, die ein Hermes-Update einspielen würde (HEAD..origin/<branch>)."""
|
||||
"""Commits, die ein Hermes-Update einspielen würde (HEAD..origin/<branch>) + LLM-Zusammenfassung."""
|
||||
info: dict = {"kind": "hermes", "branch": None, "behind": 0, "commits": []}
|
||||
git = system.find_hermes_agent_git()
|
||||
if not git or not git.get("path"):
|
||||
@@ -382,6 +418,8 @@ def hermes_update_details() -> dict:
|
||||
commits.append({"hash": parts[0], "subject": parts[1], "when": parts[2]})
|
||||
info["commits"] = commits
|
||||
info["behind"] = len(commits)
|
||||
if commits:
|
||||
info["summary"] = _summarize_hermes_commits(commits)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
info["error"] = str(exc)
|
||||
return info
|
||||
@@ -549,10 +587,14 @@ def hermes_update_job() -> dict:
|
||||
backup = os.path.join(_REPO_ROOT, "deploy", "backup.sh")
|
||||
postcheck = os.path.join(_REPO_ROOT, "deploy", "hermes-postcheck.sh")
|
||||
# Backup → update → Gateway-Neustart → Gehirn-Check (Job wird rot, wenn Mem0/Plugin kaputt).
|
||||
# Backup → update → doctor (Config/Deps-Diagnose der NEUEN Version) → Gateway-Neustart →
|
||||
# Gehirn-Check (erweitert um Config-Drift-Scan, Tool- und Voice-Smoke — Lehre aus v0.18:
|
||||
# 'approvals.mode auto' wurde still ungültig und legte alle Tools in pending_approval).
|
||||
cmd = (f"bash {backup} || true; "
|
||||
f"cd {path} && {py} -m hermes_cli.main update --yes "
|
||||
f"&& {py} -m hermes_cli.main doctor "
|
||||
f"&& systemctl --user restart hermes-gateway "
|
||||
f"&& sleep 4 && bash {postcheck}")
|
||||
f"&& sleep 6 && bash {postcheck}")
|
||||
|
||||
def on_done():
|
||||
_comp_cache.update(ts=0.0, data=[]) # Update-Status neu berechnen lassen
|
||||
|
||||
Reference in New Issue
Block a user