Repository navigation
feat(sandbox-utils): fetch_container_logs takes max_chars per stream - #918
Open
andrewpark-scaleai wants to merge 3 commits into
Open
andrewpark-scaleai wants to merge 3 commits into
andrewpark-scaleai wants to merge 3 commits into
Conversation
The 500-character default keeps the result small enough to inline in an error message. A caller that stores the logs somewhere else can now ask for more of each stream. Existing callers keep the default.
A slice of [-0:] keeps the whole string, so max_chars=0 returned every stream in full.
The start index went negative when a stream was shorter than the limit, and Python counts a negative index from the end, so a 499-character stream kept only its last character.
This branch has not been deployed
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.
Why
fetch_container_logskeeps 500 characters of each stream. That fits inlining the logs in an error message, which is what its callers do today. A caller that stores the logs elsewhere, such as an object store, gets only the last few lines of a traceback.What changed
fetch_container_logstakes an optional keywordmax_chars, the limit for each stream of each container. It defaults to the current 500.Scope
Verification
pytest tst/unit/task_step/test_sandbox_utils_logs.py tst/unit/task_step/verifiers/test_rubrics_verifier_judge_usage.py: 27 passed. A new test checks thatmax_chars=3000keeps 3000 characters of both stdout and stderr.ruff checkpasses on the changed files.

Confidence Score: 5/5
The PR appears safe to merge; the short-stream bug is fixed and no new actionable issues remain.Summary
fetch_container_logsadds a keyword-onlymax_charslimit for each stream, keeping the default of 500 characters.Reviews (3) · Last reviewed commit: "fix(sandbox-utils): a stream shorter tha..." · Reviewed by Greptile