Claude Code Claude Opus 4.6 commited on
Commit
2af593f
·
1 Parent(s): b5ed151

Claude Code: Fix Docker path resolution in error_handlers.py - remove restrictive parent.exists() checks that fail at import time

Browse files
Files changed (1) hide show
  1. error_handlers.py +2 -13
error_handlers.py CHANGED
@@ -82,20 +82,9 @@ def _resolve_status_file() -> Path:
82
  return Path(env_path)
83
 
84
  # Priority 2: /app/cain_status.json (Docker WORKDIR - primary location)
85
- # Don't check writability here - directory may not exist yet but can be created
86
  app_path = Path("/app/cain_status.json")
87
- if app_path.parent.exists():
88
- return app_path
89
-
90
- # Priority 3: OPENCLAW_DATA_DIR
91
- data_dir = os.environ.get('OPENCLAW_DATA_DIR')
92
- if data_dir:
93
- return Path(data_dir) / "cain_status.json"
94
-
95
- # Priority 4: /data (standard Docker volume mount)
96
- data_path = Path("/data/cain_status.json")
97
- if data_path.parent.exists():
98
- return data_path
99
 
100
  # Priority 5: Script directory as final fallback
101
  script_dir = Path(os.path.dirname(__file__))
 
82
  return Path(env_path)
83
 
84
  # Priority 2: /app/cain_status.json (Docker WORKDIR - primary location)
85
+ # Don't check parent.exists() - directory may be created later by write_cain_status
86
  app_path = Path("/app/cain_status.json")
87
+ return app_path
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  # Priority 5: Script directory as final fallback
90
  script_dir = Path(os.path.dirname(__file__))