Claude Code Claude Opus 4.6 commited on
Commit
b88e499
·
1 Parent(s): ef21765

Claude Code: Fix status file path resolution in error_handlers.py

Browse files

- Add priority search for openclaw/.openclaw/agents/cain_status.json
- This matches actual file location in the repo
- Falls back to /app/cain_status.json and script dir

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

Files changed (1) hide show
  1. error_handlers.py +7 -2
error_handlers.py CHANGED
@@ -93,10 +93,15 @@ def _resolve_status_file() -> Path:
93
  if env_path:
94
  return Path(env_path)
95
 
96
- # Priority 2: /app/cain_status.json (Docker WORKDIR - primary location)
 
 
 
 
 
97
  app_path = Path("/app/cain_status.json")
98
 
99
- # Priority 3: Script directory as final fallback
100
  if not app_path.parent.exists():
101
  script_dir = Path(os.path.dirname(__file__))
102
  return script_dir / "cain_status.json"
 
93
  if env_path:
94
  return Path(env_path)
95
 
96
+ # Priority 2: openclaw/.openclaw/agents/cain_status.json (actual location)
97
+ openclaw_status = Path(__file__).parent / "openclaw" / ".openclaw" / "agents" / "cain_status.json"
98
+ if openclaw_status.exists():
99
+ return openclaw_status
100
+
101
+ # Priority 3: /app/cain_status.json (legacy location)
102
  app_path = Path("/app/cain_status.json")
103
 
104
+ # Priority 4: Script directory as final fallback
105
  if not app_path.parent.exists():
106
  script_dir = Path(os.path.dirname(__file__))
107
  return script_dir / "cain_status.json"