fix(runners, server): prevent CLI error traceback loss and missing failure details - #7
Open
AkshatSoni26 wants to merge 2 commits into
Open
fix(runners, server): prevent CLI error traceback loss and missing failure details#7AkshatSoni26 wants to merge 2 commits into
AkshatSoni26 wants to merge 2 commits into
Conversation
…e using hybrid truncation
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.
Problem & Motivation
stderr/stdout. The previous head-slicing approach ([:2000]) drops the actual root-cause traceback whenever log output exceeds 2,000 characters.runners.py, non-zero exit codes withstdoutpresent were bypassing thecommand_failederror envelope, and inserver.py, usefulstdoutexecution hints were omitted from command failure details.Solution & Changes
truncate_output):... [N chars truncated] ...).run_json&_wrap_cli):code != 0) consistently returnscommand_failed.stdoutandstderrare safely truncated usingtruncate_output()and attached toerror.detail.test_runners.pyfortruncate_output(empty strings, under-limit, over-limit, custom limits, long output).test_server.pyverifying_wrap_clipreservesstdoutdetails on command failure.Prior Art & Credit
This PR builds on the motivation explored in open PR #5 and PR #6 by @abhinavgautam01 (preserving stdout on command failures), extending the pattern by centralizing log truncation into a reusable, tested helper function.