Spaces:
Sleeping
Sleeping
Claude Code Claude Opus 4.6 commited on
Commit ·
eaed9e2
1
Parent(s): 2a9d17c
Claude Code: Fix hardcoded /app/openclaw paths → use /app directly
Browse filesAligns sys.path setup and status file resolution with Docker WORKDIR.
.openclaw is at /app/.openclaw, not /app/openclaw/.openclaw.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- error_handlers.py +6 -6
error_handlers.py
CHANGED
|
@@ -14,12 +14,12 @@ 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 |
-
# Note: Docker WORKDIR is /app, .openclaw is at /app/.openclaw
|
| 18 |
-
|
| 19 |
_openclaw_internal_dir = Path(__file__).parent / ".openclaw" # /app/.openclaw
|
| 20 |
|
| 21 |
-
# Add
|
| 22 |
-
for path_dir in [
|
| 23 |
path_str = str(path_dir)
|
| 24 |
if path_str not in sys.path and path_dir.exists():
|
| 25 |
sys.path.insert(0, path_str)
|
|
@@ -94,8 +94,8 @@ def _resolve_status_file() -> Path:
|
|
| 94 |
if env_path:
|
| 95 |
return Path(env_path)
|
| 96 |
|
| 97 |
-
# Priority 2:
|
| 98 |
-
openclaw_status = Path(__file__).parent / "
|
| 99 |
if openclaw_status.exists():
|
| 100 |
return openclaw_status
|
| 101 |
|
|
|
|
| 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
|
| 18 |
+
_openclaw_base_dir = Path(__file__).parent # /app
|
| 19 |
_openclaw_internal_dir = Path(__file__).parent / ".openclaw" # /app/.openclaw
|
| 20 |
|
| 21 |
+
# Add /app and /app/.openclaw to sys.path for agents imports
|
| 22 |
+
for path_dir in [_openclaw_base_dir, _openclaw_internal_dir]:
|
| 23 |
path_str = str(path_dir)
|
| 24 |
if path_str not in sys.path and path_dir.exists():
|
| 25 |
sys.path.insert(0, path_str)
|
|
|
|
| 94 |
if env_path:
|
| 95 |
return Path(env_path)
|
| 96 |
|
| 97 |
+
# Priority 2: /app/.openclaw/agents/cain_status.json (actual location)
|
| 98 |
+
openclaw_status = Path(__file__).parent / ".openclaw" / "agents" / "cain_status.json"
|
| 99 |
if openclaw_status.exists():
|
| 100 |
return openclaw_status
|
| 101 |
|