Claude Code Claude Opus 4.6 commited on
Commit
e56588b
·
1 Parent(s): 1994d47

Claude Code: Fix A2A communication - correct openclaw path resolution for Docker

Browse files

The openclaw/__init__.py was looking for .openclaw at /app/openclaw/.openclaw
but Dockerfile copies it to /app/.openclaw/. Added fallback path resolution.

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

Files changed (1) hide show
  1. openclaw/__init__.py +9 -3
openclaw/__init__.py CHANGED
@@ -4,14 +4,20 @@ import sys
4
  from pathlib import Path
5
 
6
  # Get the openclaw package directory
7
- _package_dir = Path(__file__).parent
8
- _openclaw_dir = _package_dir / ".openclaw"
 
 
 
 
 
9
 
10
  # Add both openclaw parent (for agents) and .openclaw to the module search path
11
  if str(_package_dir) not in sys.path:
12
  sys.path.insert(0, str(_package_dir))
13
 
14
- if str(_openclaw_dir) not in sys.path:
 
15
  sys.path.insert(0, str(_openclaw_dir))
16
 
17
  __version__ = "0.1.0"
 
4
  from pathlib import Path
5
 
6
  # Get the openclaw package directory
7
+ _package_dir = Path(__file__).parent # /app/openclaw
8
+
9
+ # Docker path fix: .openclaw is at /app/.openclaw, not /app/openclaw/.openclaw
10
+ # Try relative path first (for local dev), fall back to /app/.openclaw (for Docker)
11
+ _openclaw_dir = _package_dir / ".openclaw" # /app/openclaw/.openclaw (local)
12
+ if not _openclaw_dir.exists():
13
+ _openclaw_dir = _package_dir.parent / ".openclaw" # /app/.openclaw (Docker)
14
 
15
  # Add both openclaw parent (for agents) and .openclaw to the module search path
16
  if str(_package_dir) not in sys.path:
17
  sys.path.insert(0, str(_package_dir))
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"