feat: "ARIA reparieren"-Button in App + Diagnostic
Bei stuck OpenClaw-Runs (ARIA antwortet nicht mehr / "Antwort ohne Text"
auf jede Anfrage) kann der User jetzt selbst openclaw doctor --fix
anstossen — ohne SSH/docker exec.
Pfad:
- App-Button → rvs.send('doctor_fix') → Bridge → HTTP POST an
Diagnostic /api/doctor-fix → dockerExec aria-core
- Diagnostic-Button → direkt HTTP POST /api/doctor-fix
Zwei Plaetze in der App: oben in der Thinking-Bubble (wenn ARIA denkt
aber haengt) und in Settings → Reparatur (immer erreichbar). In
Diagnostic neben dem Abbrechen-Button im Thinking-Indicator.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1580,6 +1580,43 @@ class ARIABridge:
|
||||
except Exception as e:
|
||||
logger.warning("[rvs] file_saved konnte nicht an App gesendet werden: %s", e)
|
||||
|
||||
elif msg_type == "doctor_fix":
|
||||
# App-Button "ARIA reparieren" → openclaw doctor --fix anstossen.
|
||||
# Bridge erreicht aria-core nicht via docker (kein docker-socket
|
||||
# gemountet), aber der Diagnostic-Server hat den Socket. HTTP-Call
|
||||
# an http://localhost:3001/api/doctor-fix.
|
||||
logger.info("[rvs] doctor_fix Request von App — leite an Diagnostic weiter")
|
||||
try:
|
||||
req = urllib.request.Request(
|
||||
"http://localhost:3001/api/doctor-fix",
|
||||
data=b"{}",
|
||||
method="POST",
|
||||
headers={"Content-Type": "application/json"},
|
||||
)
|
||||
# Blocking call ist OK weil openclaw doctor schnell durchlaeuft.
|
||||
# In Executor laufen lassen damit der asyncio-Loop nicht blockt.
|
||||
def _do_fix():
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=30) as resp:
|
||||
return resp.status, resp.read().decode("utf-8", errors="ignore")
|
||||
except Exception as e:
|
||||
return None, str(e)
|
||||
status, body = await asyncio.get_event_loop().run_in_executor(None, _do_fix)
|
||||
ok = status == 200
|
||||
logger.info("[rvs] doctor_fix Result: status=%s ok=%s", status, ok)
|
||||
await self._send_to_rvs({
|
||||
"type": "chat",
|
||||
"payload": {
|
||||
"text": "[Reparatur] ARIA wurde durchgecheckt — sollte wieder antworten." if ok
|
||||
else f"[Reparatur] Fehlgeschlagen: {body[:200]}",
|
||||
"sender": "aria",
|
||||
},
|
||||
"timestamp": int(asyncio.get_event_loop().time() * 1000),
|
||||
})
|
||||
except Exception as e:
|
||||
logger.warning("[rvs] doctor_fix Weiterleitung fehlgeschlagen: %s", e)
|
||||
return
|
||||
|
||||
elif msg_type == "file_request":
|
||||
# App fordert eine Datei an (Re-Download nach Cache-Leerung)
|
||||
server_path = payload.get("serverPath", "")
|
||||
|
||||
Reference in New Issue
Block a user