Add bounded stdin to owner execution
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a06def-6490-7033-8448-2eab2d12ed44
This commit is contained in:
parent
fd9297810c
commit
b6655d8859
15 changed files with 74 additions and 17 deletions
|
|
@ -255,6 +255,7 @@ def test_execute_sends_bounded_request_to_in_namespace_owner(tmp_path) -> None:
|
|||
execution_context={"actor": "agt", "run_id": "run-1"},
|
||||
timeout_seconds=30,
|
||||
max_output_bytes=1024,
|
||||
stdin_text="task payload",
|
||||
)
|
||||
thread.join(timeout=2)
|
||||
server.close()
|
||||
|
|
@ -264,6 +265,7 @@ def test_execute_sends_bounded_request_to_in_namespace_owner(tmp_path) -> None:
|
|||
assert received["credential_route_refs"] == ["rein-openweights-openrouter-approle"]
|
||||
assert received["timeout_seconds"] == 30
|
||||
assert received["max_output_bytes"] == 1024
|
||||
assert received["stdin_text"] == "task payload"
|
||||
assert result["stdout"] == "ok\n"
|
||||
assert result["exit_code"] == 0
|
||||
|
||||
|
|
@ -278,6 +280,7 @@ def test_in_namespace_runner_uses_sanitized_environment(tmp_path) -> None:
|
|||
"execution_context": {"actor": "agt", "run_id": "run-1"},
|
||||
"timeout_seconds": 30,
|
||||
"max_output_bytes": 1024,
|
||||
"stdin_text": "task payload",
|
||||
}
|
||||
with patch(
|
||||
"sandboxer.extensions.bwrap_runner.subprocess.Popen", return_value=process
|
||||
|
|
@ -286,6 +289,7 @@ def test_in_namespace_runner_uses_sanitized_environment(tmp_path) -> None:
|
|||
|
||||
assert popen.call_args.args[0] == ["python3", "-V"]
|
||||
assert popen.call_args.kwargs["cwd"] == tmp_path
|
||||
process.communicate.assert_called_once_with(input=b"task payload", timeout=30)
|
||||
child_env = popen.call_args.kwargs["env"]
|
||||
assert child_env["SANDBOXER_ACTOR"] == "agt"
|
||||
assert child_env["SANDBOXER_RUN_ID"] == "run-1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue