Preserve UTF-8 in piped machine environment values - #3561
Merged
ymichael merged 1 commit intoSep 12, 2026
Merged
Conversation
ymichael
deleted the
bb/fixer-preserve-utf-8-in-piped-machine-values-thr_wqx43rcgsn
branch
September 12, 2026 03:50
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.
Human comments
What was wrong
The machine-environment CLI decoded every stdin chunk separately. A multibyte UTF-8 character split across pipe chunks was therefore replaced with invalid-character markers before the value was saved, even though the command reported success. This follows up on the machine-environment support added in PR #3274.
What changed
Collect stdin as bounded byte buffers and decode UTF-8 once after EOF. The existing 65,536-byte limit is still enforced on raw bytes before removing one trailing newline. Empty input, CRLF handling, secret masking, validation, and preservation of unrelated variables are unchanged.
How you verified
pnpm exec turbo run test typecheck build --filter=@bb/cli --force: 59 files and 607 tests passed; build and typecheck passed.git diff --check origin/main...HEADpassed.café,€, and🌍values were stored exactly; byte limits, masking, and unrelated-value preservation passed. Temporary variables were removed.