Claude Code Claude Opus 4.6 commited on
Commit
2dc609c
·
1 Parent(s): ebe6433

Claude Code: Fix Cain entrypoint.sh - add missing status file paths for cleaning

Browse files

- Add /app/cain_status.json to entrypoint.sh cleaning list (was missing)
- Fix _cleaned_at field to use literal 'entrypoint' instead of bash substitution
- This ensures stale 'unknown' errors are cleared from ALL possible status file locations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. entrypoint.sh +6 -4
entrypoint.sh CHANGED
@@ -53,9 +53,11 @@ import json
53
  from pathlib import Path
54
 
55
  status_files = [
56
- Path('/data/cain_status.json'),
57
- Path('/app/openclaw/.openclaw/agents/cain_status.json'),
58
- Path('/app/.openclaw/agents/cain_status.json'),
 
 
59
  ]
60
 
61
  cleaned = 0
@@ -68,7 +70,7 @@ for status_file in status_files:
68
  # Fix: if error is string 'unknown' or contains 'unknown', set to null
69
  if isinstance(error, str) and error.strip().lower() in ('unknown', 'none', 'null', ''):
70
  data['error'] = None
71
- data['_cleaned_at'] = '$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
72
  with open(status_file, 'w') as f:
73
  json.dump(data, f, indent=2)
74
  cleaned += 1
 
53
  from pathlib import Path
54
 
55
  status_files = [
56
+ Path('/data/cain_status.json'), # Primary (OPENCLAW_DATA_DIR)
57
+ Path('/app/openclaw/.openclaw/agents/cain_status.json'), # Nested structure
58
+ Path('/app/.openclaw/agents/cain_status.json'), # Legacy flat structure
59
+ # Additional paths that app.py might use (for consistency)
60
+ Path('/app/cain_status.json'),
61
  ]
62
 
63
  cleaned = 0
 
70
  # Fix: if error is string 'unknown' or contains 'unknown', set to null
71
  if isinstance(error, str) and error.strip().lower() in ('unknown', 'none', 'null', ''):
72
  data['error'] = None
73
+ data['_cleaned_at'] = 'entrypoint'
74
  with open(status_file, 'w') as f:
75
  json.dump(data, f, indent=2)
76
  cleaned += 1