|
64 | 64 | retry_async, |
65 | 65 | ) |
66 | 66 | 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 | +) |
68 | 73 |
|
69 | 74 | DEFAULT_DAYTONA_WORKSPACE_ROOT = "/home/daytona/workspace" |
70 | 75 | logger = logging.getLogger(__name__) |
@@ -365,21 +370,22 @@ def _runtime_helpers(self) -> tuple[RuntimeHelperScript, ...]: |
365 | 370 |
|
366 | 371 | async def _prepare_workspace_root(self) -> None: |
367 | 372 | """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) |
369 | 375 | try: |
370 | 376 | envs = await self._resolved_envs() |
371 | 377 | result = await self._sandbox.process.exec( |
372 | | - f"mkdir -p -- {shlex.quote(str(root))}", |
| 378 | + f"mkdir -p -- {shlex.quote(root)}", |
373 | 379 | env=envs or None, |
374 | 380 | timeout=self.state.timeouts.fast_op_s, |
375 | 381 | ) |
376 | 382 | except Exception as e: |
377 | | - raise WorkspaceStartError(path=root, cause=e) from e |
| 383 | + raise WorkspaceStartError(path=error_root, cause=e) from e |
378 | 384 |
|
379 | 385 | exit_code = int(getattr(result, "exit_code", 0) or 0) |
380 | 386 | if exit_code != 0: |
381 | 387 | raise WorkspaceStartError( |
382 | | - path=root, |
| 388 | + path=error_root, |
383 | 389 | context={ |
384 | 390 | "reason": "workspace_root_nonzero_exit", |
385 | 391 | "exit_code": exit_code, |
|
0 commit comments