Claude Code Claude Opus 4.6 commited on
Commit
2a9d17c
·
1 Parent(s): 20b8ffd

Claude Code: Fix sys.path setup - use correct .openclaw location (/app/.openclaw not /app/openclaw/.openclaw)

Browse files
Files changed (1) hide show
  1. error_handlers.py +2 -6
error_handlers.py CHANGED
@@ -14,13 +14,9 @@ from fastapi.responses import JSONResponse
14
 
15
  # CRITICAL: Set up sys.path for agents imports at module load time
16
  # This ensures `from agents import brain_minimal` works regardless of import order
 
17
  _openclaw_package_dir = Path(__file__).parent / "openclaw"
18
- _openclaw_internal_dir = _openclaw_package_dir / ".openclaw"
19
-
20
- # Verify paths exist before adding (defensive: helps debug Docker issues)
21
- if not _openclaw_internal_dir.exists():
22
- # Fallback: try .openclaw directly (in case openclaw/ structure differs)
23
- _openclaw_internal_dir = Path(__file__).parent / ".openclaw"
24
 
25
  # Add openclaw parent dir and .openclaw to sys.path for agents imports
26
  for path_dir in [_openclaw_package_dir, _openclaw_internal_dir]:
 
14
 
15
  # CRITICAL: Set up sys.path for agents imports at module load time
16
  # This ensures `from agents import brain_minimal` works regardless of import order
17
+ # Note: Docker WORKDIR is /app, .openclaw is at /app/.openclaw, not /app/openclaw/.openclaw
18
  _openclaw_package_dir = Path(__file__).parent / "openclaw"
19
+ _openclaw_internal_dir = Path(__file__).parent / ".openclaw" # /app/.openclaw
 
 
 
 
 
20
 
21
  # Add openclaw parent dir and .openclaw to sys.path for agents imports
22
  for path_dir in [_openclaw_package_dir, _openclaw_internal_dir]: