Skip to content

fix(sandbox): plumb max_output_bytes through PCSandbox for parity with command_timeout - #1043

Merged
AmitoVrito merged 1 commit into
mainfrom
fix/pcsandbox-max-output-bytes-1035
Sep 15, 2026
Merged

AmitoVrito merged 1 commit into
mainfrom
fix/pcsandbox-max-output-bytes-1035

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Summary

  • PCSandbox.__init__ accepted command_timeout but not max_output_bytes, so every PCSandbox silently built its SandboxConfig with the 1 MB default regardless of what the caller wanted.
  • attach() serialized max_output_bytes into metadata.json (added in fix(sandbox): bound subprocess output capture in run_process (fixes #1016) #1028) but never read it back on reconstruction, so a round-tripped custom value would have silently reset to the default.
  • Added the param to __init__ (default matches SandboxConfig's 1_000_000) and restored it in attach(), using .get(..., 1_000_000) so metadata written before this fix still loads.

Test plan

  • Added test_attach_restores_max_output_bytes (fake backend, no Docker needed) — spawns with a custom value, reattaches, asserts it survives. Confirmed it fails on the pre-fix code (TypeError: unexpected keyword argument) and passes after the fix.
  • Full tests/sandbox/ suite (36 tests) passes.
  • ruff check, ruff format --check, mypy clean on touched files.

Closes #1035

…h command_timeout

Fixes #1035. PCSandbox.__init__ accepted command_timeout but not
max_output_bytes, so every sandbox built its SandboxConfig with the
1 MB default; attach() serialized max_output_bytes to metadata.json
but never read it back, so a round-tripped custom value would
silently reset.

Co-authored-by: Dhruv Garg <[email protected]>
Co-authored-by: MohamedIdhries <[email protected]>
@AmitoVrito
AmitoVrito merged commit c919867 into main Sep 15, 2026
24 checks passed
@AmitoVrito
AmitoVrito deleted the fix/pcsandbox-max-output-bytes-1035 branch September 15, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PCSandbox doesn't plumb max_output_bytes (parity with command_timeout)

1 participant