Skip to content

Commit 5515283

Browse files
authored
fix: windows errors with #2956 (#2979)
1 parent 35c497e commit 5515283

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/agents/extensions/sandbox/daytona/sandbox.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@
6464
retry_async,
6565
)
6666
from ....sandbox.util.tar_utils import UnsafeTarMemberError, validate_tar_bytes
67-
from ....sandbox.workspace_paths import coerce_posix_path, posix_path_as_path, sandbox_path_str
67+
from ....sandbox.workspace_paths import (
68+
coerce_posix_path,
69+
posix_path_as_path,
70+
posix_path_for_error,
71+
sandbox_path_str,
72+
)
6873

6974
DEFAULT_DAYTONA_WORKSPACE_ROOT = "/home/daytona/workspace"
7075
logger = logging.getLogger(__name__)
@@ -365,21 +370,22 @@ def _runtime_helpers(self) -> tuple[RuntimeHelperScript, ...]:
365370

366371
async def _prepare_workspace_root(self) -> None:
367372
"""Create the workspace root before SDK exec calls use it as cwd."""
368-
root = Path(self.state.manifest.root)
373+
root = sandbox_path_str(self.state.manifest.root)
374+
error_root = posix_path_for_error(root)
369375
try:
370376
envs = await self._resolved_envs()
371377
result = await self._sandbox.process.exec(
372-
f"mkdir -p -- {shlex.quote(str(root))}",
378+
f"mkdir -p -- {shlex.quote(root)}",
373379
env=envs or None,
374380
timeout=self.state.timeouts.fast_op_s,
375381
)
376382
except Exception as e:
377-
raise WorkspaceStartError(path=root, cause=e) from e
383+
raise WorkspaceStartError(path=error_root, cause=e) from e
378384

379385
exit_code = int(getattr(result, "exit_code", 0) or 0)
380386
if exit_code != 0:
381387
raise WorkspaceStartError(
382-
path=root,
388+
path=error_root,
383389
context={
384390
"reason": "workspace_root_nonzero_exit",
385391
"exit_code": exit_code,

0 commit comments

Comments
 (0)