Repository navigation
fix(trial): keep multibyte output whole across stdout chunks - #394
Open
BenSheridanEdwards wants to merge 2 commits into
Open
BenSheridanEdwards wants to merge 2 commits into
BenSheridanEdwards wants to merge 2 commits into
Conversation
exec appended each Buffer chunk to a string, decoding it on its own, so a UTF-8 character split across a pipe chunk boundary became two U+FFFD replacement characters. Large trial patches with non-ASCII text could be written corrupted. Decode stdout and stderr as streams with setEncoding; stdoutFile still receives raw bytes. Fixes #388. 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.
Why does this feature exist?
Decoding each process-output Buffer independently corrupts UTF-8 characters split across chunks, which can corrupt saved trial patches. Fixes #388.
What changed?
Reuse the existing stream-decoding implementation from commit a4aba4aba7dffb34cb1195804f475cebfc5e8d25. Extend its regressions to use large stdin, delayed partial characters on each pipe, and raw stdout-file bytes. Preserve the original authorship. The shared fake-agent fixture commits through normal hooks; every result-commit assertion is retained.
Behavioural Proof (with video and screenshots)
Verification Summary
pnpm exec jest --selectProjects tooling --testPathPattern tooling/trial/run-trial.test.ts --runInBand --testNamePattern '^runTrial makes the one result commit with the hooks on, whatever the agent committed$';pnpm install --frozen-lockfile;pnpm lint:anti-slop;pnpm verify;pnpm e2e. Full verification ran through the shared heavy-suite limiter in the normal pre-push hook.pnpm verifypnpm e2e.agents/project/ARCHITECTURE.mdandCONVENTIONS.md.PRD Behaviours to Review
PR Proof Law
.agents/project/PR_QUALITY.mdand.agents/skills/pr-quality-contract/SKILL.md; thePR qualitycheck verifies the proof format.