Fix large piped output hanging and duplicating bytes - #10
Merged
Merged
Conversation
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.
Summary
Fixes #8.
Large piped output can hang and repeat its first 64 KiB after a dependency accesses
process.stdout. Use lazy Bun FileSinks for stdout and stderr, awaiting each write and flush before the CLI exits. Text/JSON output and the in-process capture API stay compatible.Add bounded real-pipe regressions for backpressure, UTF-8 byte integrity, sequential writes, immediate exit, restored capture, and early consumer closure. Exercise full CLI Markdown/AST output and run the output contract on macOS with Bun 1.3.10 and latest. Update the output guidance and CI documentation.
Test plan
bun run check(lint, types, dead code).No LibreOffice checks were run during final review. Native Windows/Linux execution and the new GitHub CI jobs have not been run locally. The pre-commit full-suite hook was skipped to avoid launching LibreOffice; the checks above were run separately.