Repository navigation
fix(start): print a failed trial's error line by line - #256
Merged
Merged
Conversation
A failed trial step raised TrialError with the step, the last lines of its output and the kept-folder note joined by "\n", and `start` wrapped it in a plain ClickException, which the error boundary escapes to one line: the diagnostics came out joined by a literal \x0a (the #254 defect on the --trial path). TrialError now keeps its lines; the step's output lines are labelled " | " like other command output, and `start --trial` raises _MultilineError so each line is still escaped on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #254 / #255: the same defect on the
start --trialpath. It was found in review of #255. There is no separate issue, so this PR description carries the report.What was wrong
When a trial step failed,
TrialErrorjoined three things with\n:startthen wrapped the message in a plainclick.ClickException. The CLI error boundary escapes such a message to one line, so the user saw one long line with a literal\x0abetween the parts, and the diagnostics became hard to read.What changes
TrialError(*lines)keeps the line structure in alinestuple;str()is the newline join, as before.TrialSandbox._runputs each line of the failed step's output on its own line, prefixed with|. That is the label the error boundary already uses for a command's output (_output_lines), so external output never reads as syncmill's own line.run_trialre-raises withexc.linesplus the kept-folder line.start --trialraises_MultilineError(*exc.lines), so each line is still escaped on its own: an ESC in the step's output shows as\x1b.Tests
test_a_failed_trial_keeps_its_folder_and_says_wherenow asserts the exact lines instead of substrings.test_a_failed_step_keeps_each_output_line_on_its_owndrives a real failing subprocess throughTrialSandbox._run.test_start_prints_a_trial_failure_line_by_linechecks the exact CLI output, including an escaped ESC on a labelled line.Verification
suite-runCLEAN on macOS.clientry point with a broken trial scenario:Error: no candidate passed verification; the trial scenario is brokenandThe trial folder was kept for inspection: …print on two lines, exit 1.🤖 Generated with Claude Code