Repository navigation
fix(sandbox): plumb max_output_bytes through PCSandbox for parity with command_timeout - #1043
Merged
Merged
Conversation
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PCSandbox.__init__acceptedcommand_timeoutbut notmax_output_bytes, so everyPCSandboxsilently built itsSandboxConfigwith the 1 MB default regardless of what the caller wanted.attach()serializedmax_output_bytesintometadata.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.__init__(default matchesSandboxConfig's 1_000_000) and restored it inattach(), using.get(..., 1_000_000)so metadata written before this fix still loads.Test plan
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.tests/sandbox/suite (36 tests) passes.ruff check,ruff format --check,mypyclean on touched files.Closes #1035