Skip to content

test(sandbox): test host sandbox through process fake - #2918

Merged
dan-petty merged 2 commits into
mainfrom
test/2149-sandbox-process-fake
Oct 31, 2026
Merged

dan-petty merged 2 commits into
mainfrom
test/2149-sandbox-process-fake

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Deliver process fake support for host sandbox and tool executor tests.

  • Add spawn_sandbox and terminate_process_group to ProcessRunner and DefaultProcessRunner in core/process.py.
  • Remove mock detection code _is_mock_subprocess and _communicate_mock from sandbox/host.py.
  • Implement FakeSandboxProcess in tests/support/fakes/process.py with real OS pipes.
  • Add tests in tests/sandbox/test_host_sandbox.py for output cap breach, deadline timeout, and hung process reaping.
  • Deselect bwrap-marked tests by default unless selected with -m bwrap in tests/conftest.py.
  • Migrate tool executor contract tests in tests/ai/test_tool_executor_contract.py to use shared fakes.
  • Archive OpenSpec change 2149-sandbox-process-fake.
  • Increase sandbox/host.py test coverage from 69% to 92%.

Closes #2149

Deliver process fake support for host sandbox and tool executor tests.

- Add spawn_sandbox and terminate_process_group methods to ProcessRunner and DefaultProcessRunner in core/process.py.
- Remove mock detection code _is_mock_subprocess and _communicate_mock from sandbox/host.py.
- Implement FakeSandboxProcess in tests/support/fakes/process.py with real OS pipes.
- Add tests in tests/sandbox/test_host_sandbox.py for output cap breach, deadline timeout, and hung process reaping.
- Deselect bwrap-marked tests by default unless selected with -m bwrap in tests/conftest.py.
- Migrate tool executor contract tests in tests/ai/test_tool_executor_contract.py to use shared fakes.
- Archive OpenSpec change 2149-sandbox-process-fake.
- Increase sandbox/host.py test coverage to 92%.

Closes #2149
@dan-petty dan-petty added type/test Type test: a new or changed test scope/sandbox The bubblewrap sandbox and its egress rules labels Oct 31, 2026
@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 20:33
@dan-petty
dan-petty merged commit 06d9c76 into main Oct 31, 2026
19 checks passed
@dan-petty
dan-petty deleted the test/2149-sandbox-process-fake branch October 31, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/sandbox The bubblewrap sandbox and its egress rules type/test Type test: a new or changed test

Projects

None yet

1 participant