Skip to content

Commit 7f460d1

Browse files
committed
fix(sprites): coerce mount path to POSIX for Windows test runners
`_verify_mount_active` constructed shell commands and error context using `str(mount_path)`, which on Windows runners produces ``\workspace\tigris`` and breaks the in-VM `mountpoint` probe (the sprite is always POSIX). Use `Path.as_posix()` so host OS doesn't leak into the remote command. Also re-applies ruff formatting on sandbox.py after the merge.
1 parent 112dbf4 commit 7f460d1

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/agents/extensions/sandbox/sprites/mounts.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ async def _verify_mount_active(session: BaseSandboxSession, mount_path: Path) ->
136136
time to bind.
137137
"""
138138

139-
quoted = shlex.quote(str(mount_path))
139+
# ``Path.as_posix()`` gives forward-slash form regardless of host OS,
140+
# which matters because the mount target lives inside the sprite VM
141+
# (POSIX) — running on a Windows agent would otherwise emit
142+
# ``\workspace\tigris`` here.
143+
posix_path = mount_path.as_posix()
144+
quoted = shlex.quote(posix_path)
140145
probe_cmd = (
141146
f"for _ in 1 2 3 4 5 6 7 8 9 10; do "
142147
f"if mountpoint -q {quoted}; then echo {_MOUNTED}; exit 0; fi; "
@@ -147,7 +152,7 @@ async def _verify_mount_active(session: BaseSandboxSession, mount_path: Path) ->
147152
if not _stdout_says(probe, _MOUNTED):
148153
raise MountConfigError(
149154
message="rclone mount completed but the path is not a live mountpoint",
150-
context={"path": str(mount_path)},
155+
context={"path": posix_path},
151156
)
152157

153158
# Force rclone to materialize the root directory listing before we hand

src/agents/extensions/sandbox/sprites/sandbox.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,7 @@ async def _try_attach_existing_sprite(self) -> Sprite | None:
406406

407407
client = self._ensure_client_sync()
408408
try:
409-
sprite: Sprite = await asyncio.to_thread(
410-
client.get_sprite, self.state.sprite_name
411-
)
409+
sprite: Sprite = await asyncio.to_thread(client.get_sprite, self.state.sprite_name)
412410
except NotFoundError:
413411
return None
414412
# Re-bind a Sprite handle with the live status snapshot as ``_sprite``;

0 commit comments

Comments
 (0)