fix(cli): Propagate bundle render output errors - #618
Merged
stefanprodan merged 1 commit intoAug 10, 2026
Conversation
Bundle build assembles the full render in memory and writes stdout in one pass only after every instance succeeds, but the final Write result was discarded, so a failing or short writer could receive incomplete output while the command reported success. Propagate the writer error and report io.ErrShortWrite when a nil-error writer accepts fewer bytes. The --output-dir path is unchanged. Signed-off-by: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com> Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
stefanprodan
approved these changes
Aug 10, 2026
stefanprodan
left a comment
Owner
There was a problem hiding this comment.
LGTM
Thanks @reneleonhardt
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.
What
Make a successful
timoni bundle buildexit guarantee that the complete in-memory render was accepted by stdout. Propagate the final writer error, and reportio.ErrShortWritewhen the writer accepts fewer bytes without returning an error. The command, flags, rendered bytes, ordering, concurrency, and existing--output-dirbehavior stay unchanged; the--output-dirpath already returned file write errors and is untouched.Why
Bundle rendering already has an excellent automation shape: Timoni builds every instance in memory, preserves bundle order, and performs one final stdout write only after the whole render succeeds. The final
Writeresult is currently discarded, so a full, closed, or otherwise failing output sink can receive incomplete data while Timoni reports success. This fix turns the exit status into a dependable completeness signal for artifact pipelines and other render-only consumers, without adding a destination directory, staging tree, or apply step.Reproduction
The command before and after this change is identical.
What the reviewer must decide
timoni buildon its existing behavior (it already propagates the write error but does not check short writes) is acceptable, or whether the two render commands should share the same check.Verification
The focused suite covers a sentinel writer failure, a nil-error short write, an ordinary render failure with zero output, existing stdout bytes and ordering, and unchanged directory output.
Developed with carefully directed, manually reviewed AI assistance.
Co-Authored-By: GPT-5.6 Sol codex@openai.com