feat: auto_heal.py + api/autoheal + F Tab auto-heal display

This commit is contained in:
hmo
2026-07-18 12:28:47 +08:00
parent e4a9b7ff55
commit c43486a6f2
3 changed files with 312 additions and 0 deletions
+13
View File
@@ -943,6 +943,19 @@ def api_todos():
return jsonify({"todos": todos, "executor_log_tail": executor_tail, "count": len(todos)})
@app.route("/api/autoheal")
def api_autoheal():
"""最近一次自动修复记录(auto_heal.py 写入的摘要)。"""
sf = TEMP_DIR / "last_auto_heal.json"
if sf.exists():
try:
with open(str(sf)) as f:
return jsonify(json.load(f))
except:
pass
return jsonify({"time": None, "dry_run": False, "total_expected": 0, "anomalies_found": 0, "actions_taken": []})
# ════════════════════════════════════════════════════════════
# F — 期望状态 vs 实际状态
# ════════════════════════════════════════════════════════════