Spaces:
Sleeping
Sleeping
Claude Code commited on
Commit ·
d3303dc
1
Parent(s): 4e2242c
Claude Code: [TASK] Investigate Cain's error logs and diagnose the actual issue. Chec
Browse files
openclaw/.openclaw/health_monitor.py
CHANGED
|
@@ -936,8 +936,18 @@ def read_current_stage() -> str:
|
|
| 936 |
if cleaned_count > 0:
|
| 937 |
logger.info(f"Pre-read cleanup: cleaned {cleaned_count} status file(s)")
|
| 938 |
|
| 939 |
-
# Now read from the primary location
|
| 940 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 941 |
with open(status_file) as f:
|
| 942 |
data = json.load(f)
|
| 943 |
|
|
|
|
| 936 |
if cleaned_count > 0:
|
| 937 |
logger.info(f"Pre-read cleanup: cleaned {cleaned_count} status file(s)")
|
| 938 |
|
| 939 |
+
# Now read from the primary location - use the FIRST one that exists
|
| 940 |
+
# This ensures we read the same file we just cleaned
|
| 941 |
+
status_file = None
|
| 942 |
+
for sp in _all_possible_status_paths:
|
| 943 |
+
if sp.exists():
|
| 944 |
+
status_file = sp
|
| 945 |
+
break
|
| 946 |
+
|
| 947 |
+
# If none exist, fall back to default
|
| 948 |
+
if status_file is None:
|
| 949 |
+
status_file = Path("/data/cain_status.json")
|
| 950 |
+
|
| 951 |
with open(status_file) as f:
|
| 952 |
data = json.load(f)
|
| 953 |
|