From dc6194eb4d8530eabc0a6582471eaabe6c2c7caf Mon Sep 17 00:00:00 2001 From: Slava Trofimov <26082149+pmbstyle@users.noreply.github.com> Date: Mon, 18 May 2026 12:49:26 -0400 Subject: [PATCH 1/2] mount skills in worker workspace root --- src/octopal/runtime/workers/launcher.py | 5 +++-- tests/test_worker_launcher_isolation.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/octopal/runtime/workers/launcher.py b/src/octopal/runtime/workers/launcher.py index 631c380..028f35a 100644 --- a/src/octopal/runtime/workers/launcher.py +++ b/src/octopal/runtime/workers/launcher.py @@ -94,8 +94,9 @@ async def launch( rel_path="skills", source_path=host_skills_dir, ) - cmd_args.extend(["-v", f"{host_skills_dir}:{container_worker_dir}/skills"]) - seen_mounts.add((str(host_skills_dir), f"{container_worker_dir}/skills")) + for mount_target in (f"{container_ws}/skills", f"{container_worker_dir}/skills"): + cmd_args.extend(["-v", f"{host_skills_dir}:{mount_target}"]) + seen_mounts.add((str(host_skills_dir), mount_target)) for rel_path in allowed_paths or []: if not isinstance(rel_path, str) or not rel_path.strip(): continue diff --git a/tests/test_worker_launcher_isolation.py b/tests/test_worker_launcher_isolation.py index 6f07c0f..b49d153 100644 --- a/tests/test_worker_launcher_isolation.py +++ b/tests/test_worker_launcher_isolation.py @@ -47,6 +47,7 @@ async def _fake_exec(*args, **kwargs): assert "--user" in args assert "1000:1000" in args assert f"{worker_dir}:/workspace/workers/worker-1" in args + assert f"{workspace / 'skills'}:/workspace/skills" in args assert f"{workspace / 'skills'}:/workspace/workers/worker-1/skills" in args assert "-e" in args assert "OCTOPAL_WORKSPACE_DIR=/workspace" in args @@ -93,6 +94,7 @@ async def _fake_exec(*args, **kwargs): assert "--user" in args assert "1000:1000" in args assert f"{worker_dir}:/workspace/workers/worker-1" in args + assert f"{workspace / 'skills'}:/workspace/skills" in args assert f"{workspace / 'skills'}:/workspace/workers/worker-1/skills" in args assert f"{shared_dir}:/workspace/src" in args assert f"{shared_dir}:/workspace/workers/worker-1/src" in args From f73293c94d76ebb2739b4b707caa1862869df73b Mon Sep 17 00:00:00 2001 From: Slava Trofimov <26082149+pmbstyle@users.noreply.github.com> Date: Mon, 18 May 2026 12:56:09 -0400 Subject: [PATCH 2/2] mount worker skill envs --- src/octopal/runtime/workers/launcher.py | 27 ++++++++++++++++--------- tests/test_worker_launcher_isolation.py | 5 +++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/octopal/runtime/workers/launcher.py b/src/octopal/runtime/workers/launcher.py index 028f35a..f7dd5ef 100644 --- a/src/octopal/runtime/workers/launcher.py +++ b/src/octopal/runtime/workers/launcher.py @@ -8,6 +8,8 @@ from pathlib import Path from typing import Protocol +_WORKER_SHARED_WORKSPACE_DIRS = ("skills", ".skill-envs") + class WorkerLauncher(Protocol): async def launch( @@ -87,16 +89,21 @@ async def launch( host_ws_path = Path(self.host_workspace).resolve() seen_mounts: set[tuple[str, str]] = set() - host_skills_dir = host_ws_path / "skills" - host_skills_dir.mkdir(parents=True, exist_ok=True) - _prepare_worker_mount_target( - host_worker_dir, - rel_path="skills", - source_path=host_skills_dir, - ) - for mount_target in (f"{container_ws}/skills", f"{container_worker_dir}/skills"): - cmd_args.extend(["-v", f"{host_skills_dir}:{mount_target}"]) - seen_mounts.add((str(host_skills_dir), mount_target)) + for rel_path in _WORKER_SHARED_WORKSPACE_DIRS: + host_shared_dir = host_ws_path / rel_path + host_shared_dir.mkdir(parents=True, exist_ok=True) + _prepare_worker_mount_target( + host_worker_dir, + rel_path=rel_path, + source_path=host_shared_dir, + ) + mount_targets = ( + f"{container_ws}/{rel_path}", + f"{container_worker_dir}/{rel_path}", + ) + for mount_target in mount_targets: + cmd_args.extend(["-v", f"{host_shared_dir}:{mount_target}"]) + seen_mounts.add((str(host_shared_dir), mount_target)) for rel_path in allowed_paths or []: if not isinstance(rel_path, str) or not rel_path.strip(): continue diff --git a/tests/test_worker_launcher_isolation.py b/tests/test_worker_launcher_isolation.py index b49d153..b445488 100644 --- a/tests/test_worker_launcher_isolation.py +++ b/tests/test_worker_launcher_isolation.py @@ -49,6 +49,8 @@ async def _fake_exec(*args, **kwargs): assert f"{worker_dir}:/workspace/workers/worker-1" in args assert f"{workspace / 'skills'}:/workspace/skills" in args assert f"{workspace / 'skills'}:/workspace/workers/worker-1/skills" in args + assert f"{workspace / '.skill-envs'}:/workspace/.skill-envs" in args + assert f"{workspace / '.skill-envs'}:/workspace/workers/worker-1/.skill-envs" in args assert "-e" in args assert "OCTOPAL_WORKSPACE_DIR=/workspace" in args assert "HOME=/workspace/workers/worker-1" in args @@ -96,6 +98,8 @@ async def _fake_exec(*args, **kwargs): assert f"{worker_dir}:/workspace/workers/worker-1" in args assert f"{workspace / 'skills'}:/workspace/skills" in args assert f"{workspace / 'skills'}:/workspace/workers/worker-1/skills" in args + assert f"{workspace / '.skill-envs'}:/workspace/.skill-envs" in args + assert f"{workspace / '.skill-envs'}:/workspace/workers/worker-1/.skill-envs" in args assert f"{shared_dir}:/workspace/src" in args assert f"{shared_dir}:/workspace/workers/worker-1/src" in args assert "OCTOPAL_WORKSPACE_DIR=/workspace" in args @@ -150,6 +154,7 @@ async def _fake_exec(*args, **kwargs): args = captured["args"] assert (worker_dir / "skills").is_dir() + assert (worker_dir / ".skill-envs").is_dir() assert (worker_dir / "memory" / "canon" / "facts.md").is_file() assert (worker_dir / "research" / "jobs").is_dir() assert f"{shared_file}:/workspace/workers/worker-1/memory/canon/facts.md" in args