You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(git): preserve binary output through termination barriers - #32633
Git commands that request binary output and wait for complete child termination can corrupt non-UTF-8 bytes. They now return the original bytes on success and failure.
What Changed
Retain bounded raw stdout and stderr through process-host capture, including its synchronous API. The Git termination-barrier path uses those buffers directly and strips WSL control markers through reversible Latin-1 mapping. Error-message text alone is decoded as UTF-8.
Why
On untouched main, a real Git blob containing [0,255,128,10] returned [0,239,191,189,239,191,189,10] through public gitExecFileAsync with { encoding: 'buffer', terminationBarrier: true }. The existing bounded byte sink preserves the original data while retaining output caps and termination behavior.
Linked Issue
Discovered during independent validation of @fancive’s #30961. This separate correction contains no code adopted from that PR.
Visual Proof
N/A — this changes subprocess byte capture and has no visible UI flow.
Testing
Reproduced before the fix through public production runner exports, actual Git and a disposable repository; the identical witness passes after the main refresh.
Added real-child byte regressions for success, nonzero exit, truncation, WSL markers, timeout and abort, plus async/sync process-host byte coverage.
After the final refresh: 128 tests across 14 focused suites, full Node typecheck, all seven changed-code quality scans, scoped anti-slop, formatting and whitespace checks pass.
Independent review passed 55 tests, including 33 reviewer-authored adversarial cases. All five changed files have identical parsed code and types after refreshing onto main.
Local checks ran on macOS/Node24. Exact-head CI now passed all ten workflows, including Linux/Windows packaging, platform preflight, Windows SSH hosts, headless server, mobile, and Ubuntu/Debian/Fedora WSL. Final rollup: 53 successful checks and 10 expected skips. Fedora setup exceeded its 45-minute limit on the first attempt; one failed-only retry passed both Orca test phases, preserving successful jobs.
Review
Independent adversarial review: LOW merge risk; no blockers. Five changed files, +141/−10. Text defaults, spawn policy, termination proof, admission, deadlines and input handling retain their existing behavior. The new byte flags are internal package options and add no wire-protocol fields.
Agent skill upstream boundary
Not applicable; no upstream skill-installer material is copied or translated.
Checklist
Small, focused change with a real before/after reproduction.
Self-review and independent correctness, compatibility and performance review completed.
Folder workspaces, remote hosts, mobile clients and platform behavior considered.
Fresh full PR workflow and all platform workflows pass at exact head 7be53ffbd5ef38c5c90c6f7df6ed8137ddaa93fa.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
📝 Walkthrough
Process execution now supports optional stderr capture as bytes in asynchronous and synchronous runs. The command runner requests byte capture for buffer output and preserves captured bytes through termination-marker stripping. Tests cover binary stdout and stderr, truncation, nonzero exit, abort, timeout, and marker removal.
Priority: ➖ Normal
Merge Risk:⚪ Minimal · up to 7be53
The available evidence identifies no issue that needs correction before merge. Complete the normal platform and CI checks.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 5 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title "fix(git): preserve binary output through termination barriers" names the main change. The raw summary shows process-host byte capture, the Git termination-barrier path using raw buffers, an…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The pull request description is detailed and covers the change, motivation, testing, review, visual proof, compatibility considerations, and checklist. It provides a reference to issue #30961, but it …
Full details: Title check
Explanation
The title "fix(git): preserve binary output through termination barriers" names the main change. The raw summary shows process-host byte capture, the Git termination-barrier path using raw buffers, and regression tests for binary stdout and stderr. The title follows a conventional commit format and is specific. It does not mention the process-host stderr byte option, but that is a supporting detail, so the title is related to the main change.
Full details: Description check
Explanation
The pull request description is detailed and covers the change, motivation, testing, review, visual proof, compatibility considerations, and checklist. It provides a reference to issue #30961, but it does not use the required Fixes # format or include a direct issue link. The Notes section and AI Disclosure section are also omitted; the AI Disclosure omission may be valid for an internal contributor.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
ELI5
Git commands that request binary output and wait for complete child termination can corrupt non-UTF-8 bytes. They now return the original bytes on success and failure.
What Changed
Retain bounded raw stdout and stderr through process-host capture, including its synchronous API. The Git termination-barrier path uses those buffers directly and strips WSL control markers through reversible Latin-1 mapping. Error-message text alone is decoded as UTF-8.
Why
On untouched main, a real Git blob containing
[0,255,128,10]returned[0,239,191,189,239,191,189,10]through publicgitExecFileAsyncwith{ encoding: 'buffer', terminationBarrier: true }. The existing bounded byte sink preserves the original data while retaining output caps and termination behavior.Linked Issue
Discovered during independent validation of @fancive’s #30961. This separate correction contains no code adopted from that PR.
Visual Proof
N/A — this changes subprocess byte capture and has no visible UI flow.
Testing
Review
Independent adversarial review: LOW merge risk; no blockers. Five changed files, +141/−10. Text defaults, spawn policy, termination proof, admission, deadlines and input handling retain their existing behavior. The new byte flags are internal package options and add no wire-protocol fields.
Agent skill upstream boundary
Checklist
7be53ffbd5ef38c5c90c6f7df6ed8137ddaa93fa.