From d1efae37a435f19fc512441e91a3ea75524c6ee2 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sat, 4 Apr 2026 00:51:20 +0200 Subject: [PATCH] update health_persistence.py --- AppImage/components/hardware.tsx | 16 ++++++++++++++ AppImage/scripts/health_persistence.py | 30 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/AppImage/components/hardware.tsx b/AppImage/components/hardware.tsx index 631a616f..9b08e04d 100644 --- a/AppImage/components/hardware.tsx +++ b/AppImage/components/hardware.tsx @@ -1095,6 +1095,22 @@ export default function Hardware() { )} + ) : (findPCIDeviceForGPU(selectedGPU)?.driver === 'vfio-pci' || selectedGPU.pci_driver === 'vfio-pci') ? ( +
+
+
+ + + +
+
+

GPU in Switch Mode VM

+

+ This GPU is assigned to a virtual machine via VFIO passthrough. Real-time monitoring is not available from the host because the GPU is controlled by the VM. +

+
+
+
) : (
diff --git a/AppImage/scripts/health_persistence.py b/AppImage/scripts/health_persistence.py index 4e6437ed..17dc3d27 100644 --- a/AppImage/scripts/health_persistence.py +++ b/AppImage/scripts/health_persistence.py @@ -967,6 +967,36 @@ class HealthPersistence: cutoff_events = (now - timedelta(days=30)).isoformat() cursor.execute('DELETE FROM events WHERE timestamp < ?', (cutoff_events,)) + # ── Auto-resolve log errors that occurred before the last system reboot ── + # After a reboot, transient errors like OOM, service failures, etc. are resolved. + # Only resolve log errors (not disk errors which may persist across reboots). + try: + import os + # Get system boot time from /proc/stat + with open('/proc/stat', 'r') as f: + for line in f: + if line.startswith('btime '): + boot_timestamp = int(line.split()[1]) + boot_time = datetime.fromtimestamp(boot_timestamp) + # Resolve log errors that were last seen BEFORE the boot time + # These are transient errors (OOM, service crashes) that a reboot fixes + boot_time_iso = boot_time.isoformat() + cursor.execute(''' + UPDATE errors + SET resolved_at = ? + WHERE category = 'logs' + AND resolved_at IS NULL + AND acknowledged = 0 + AND last_seen < ? + AND (error_key LIKE 'log_critical_%' + OR reason LIKE '%Out of memory%' + OR reason LIKE '%service%Failed%' + OR reason LIKE '%timeout%') + ''', (now_iso, boot_time_iso)) + break + except Exception: + pass # If we can't read boot time, skip this cleanup + conn.commit() conn.close()