Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions verifiers/v1/runtimes/prime.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,16 @@ async def expose(self, port: int) -> str | None:
async def run_background(
self, argv: list[str], env: dict[str, str], log: str
) -> None:
# `&` backgrounds inside the sandbox; the job returns immediately, the process
# lives until the sandbox is deleted in stop().
inner = f"nohup {shlex.join(argv)} > {shlex.quote(log)} 2>&1 &"
result = await self.run(["sh", "-c", inner], env)
if result.exit_code != 0:
raise SandboxError(
f"prime background launch failed: {result.stderr.strip()}"
command = f"exec {shlex.join(argv)} > {shlex.quote(log)} 2>&1"
try:
await self._client.start_background_job(
self.info.id,
command,
working_dir=self.config.workdir,
env=env,
)
except Exception as e:
raise SandboxError(f"prime background launch failed: {e}") from e

async def _read(self, path: str) -> bytes:
# Avoid background-job log limits and base64 overhead by downloading binary data directly.
Expand Down
Loading