Repository navigation
fix(sandbox): bound subprocess output capture in run_process (fixes #1016) - #1028
MohamedIdhries wants to merge 1 commit into
Conversation
|
Merged via #1036 — thanks @MohamedIdhries. This matches the design we landed on in #1016 exactly: concurrent stdout/stderr drain (no pipe deadlock), kills the child on overflow, safe decode with the truncation marker, and the One small follow-up I filed as #1035: the |
Closes #1016
Summary
max_output_bytestoSandboxConfig(defaulting to 1,000,000) with> 0validation in__post_init__.max_output_bytesparameter torun_processand updatedSandboxBackend.exec/SandboxEnvironment.execto pass it through.process.communicate()insandbox/backends/base.py:run_processfor a streaming chunk reader that kills the subprocess as soon as output exceedsmax_output_bytes, appending\n[output truncated].tests/sandbox/test_backends.py.cc @AmitoVrito