Skip to content

Commit 60d74d7

Browse files
madiatorclaude
andcommitted
Enforce per-execution timeout via shell timeout command
The sandbox lifecycle timeout (timeout_secs) is a safety net, not the per-execution limit. Use `timeout N` in the shell command to kill the python process after exactly N seconds, matching the old subprocess.run timeout behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c79105d commit 60d74d7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/bespokelabs/curator/code_executor/code_execution_backend/sandbox_backend.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _execute_in_sandbox(
8787
sb.write_file(f"{WORKSPACE_DIR}/program.py", code)
8888
sb.write_file(f"{WORKSPACE_DIR}/input.txt", code_input)
8989

90-
result = sb.execute_command("bash", args=["-c", f"cd {WORKSPACE_DIR} && python program.py < input.txt"])
90+
result = sb.execute_command("bash", args=["-c", f"cd {WORKSPACE_DIR} && timeout {timeout} python program.py < input.txt"])
9191

9292
files = _collect_sandbox_files(sb)
9393

0 commit comments

Comments
 (0)