Spaces:
Sleeping
Sleeping
Claude Code Claude Opus 4.6 commited on
Commit ·
e74ef2e
1
Parent(s): 85d96fe
Claude Code: Fix openclaw path resolution - use direct nested path
Browse filesSimplify __init__.py to always use openclaw/.openclaw path
instead of complex fallback logic that may fail.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- openclaw/__init__.py +8 -13
openclaw/__init__.py
CHANGED
|
@@ -4,20 +4,15 @@ import sys
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
# Get the openclaw package directory
|
| 7 |
-
_package_dir = Path(__file__).parent # /app/openclaw
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
_openclaw_dir = _package_dir.parent / ".openclaw" # /app/.openclaw (Docker)
|
| 14 |
|
| 15 |
-
# Add
|
| 16 |
-
if str(
|
| 17 |
-
sys.path.insert(0, str(
|
| 18 |
-
|
| 19 |
-
# Critical: Add .openclaw to sys.path so "from agents import brain_minimal" works
|
| 20 |
-
if str(_openclaw_dir) not in sys.path and _openclaw_dir.exists():
|
| 21 |
-
sys.path.insert(0, str(_openclaw_dir))
|
| 22 |
|
| 23 |
__version__ = "0.1.0"
|
|
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
# Get the openclaw package directory
|
| 7 |
+
_package_dir = Path(__file__).parent # /app/openclaw (Docker) or workspace/openclaw (local)
|
| 8 |
|
| 9 |
+
# The .openclaw directory is always inside the openclaw package directory
|
| 10 |
+
# Docker: /app/openclaw/.openclaw
|
| 11 |
+
# Local: workspace/openclaw/.openclaw
|
| 12 |
+
_openclaw_internal = _package_dir / ".openclaw"
|
|
|
|
| 13 |
|
| 14 |
+
# Add to sys.path for "from agents import brain_minimal" to work
|
| 15 |
+
if str(_openclaw_internal) not in sys.path:
|
| 16 |
+
sys.path.insert(0, str(_openclaw_internal))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
__version__ = "0.1.0"
|