stream responses and all tests passing

This commit is contained in:
2026-02-21 13:42:32 -07:00
parent 1a894faa59
commit ef2ac2f030
6 changed files with 126 additions and 40 deletions
+5 -3
View File
@@ -67,11 +67,13 @@ async def test_sandbox_run_executes_command():
sb = PodmanSandbox()
await sb.__aenter__()
result = await sb.run("echo 'hello from sandbox'")
result = sb.run("echo 'hello from sandbox'")
# Verify exec_run was called with shell wrapper
mock_container.exec_run.assert_called_once_with(
["/bin/sh", "-c", "echo 'hello from sandbox'"], workdir="/workspace"
["/bin/sh", "-c", "echo 'hello from sandbox'"],
workdir="/workspace",
demux=False,
)
assert result == "hello from sandbox\n"
@@ -83,7 +85,7 @@ async def test_tool_call_fails_if_sandbox_crashes():
# Simulate crashed sandbox (container is None)
mock_sandbox = MagicMock()
mock_sandbox.run = AsyncMock(side_effect=RuntimeError("Container crashed"))
mock_sandbox.run = MagicMock(side_effect=RuntimeError("Container crashed"))
result = await bash("ls -la", mock_sandbox)