Skip to content

fix(provider-acp): preserve UTF-8 across interleaved terminal streams - #32391

Merged
Yash-Singh1 merged 3 commits into
pingdotgg:mainfrom
StiensWout:t3/fix-interleaved-utf8-streams
Nov 7, 2026
Merged

Yash-Singh1 merged 3 commits into
pingdotgg:mainfrom
StiensWout:t3/fix-interleaved-utf8-streams

Conversation

@StiensWout

@StiensWout StiensWout commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Valid UTF-8 terminal output can be corrupted when stderr arrives between the bytes of a stdout character. For example, stdout E2, stderr X, stdout 82 AC currently returns �X�� even though both streams contain valid UTF-8.

Decode each pipe independently before appending to the shared byte-budget buffer. This preserves complete characters, literal BOMs, byte-limited truncation, and output snapshots. Resource teardown and EOF ownership are unchanged; #30297 addresses the separate pipe-drain lifecycle issue.

Validation:

  • The Deferred-controlled public terminal test fails against main with �X�� and passes with the fix, asserting € and X without requiring their relative order. It also checks readOutputSnapshot.
  • All 15 terminal tests pass. The extended multibyte truncation case is additional preservation coverage and already passes on main; it verifies the re-encoded output remains within the byte budget and contains complete characters.
  • pnpm exec vp run check:changed passed format, lint, knip, affected-package typechecks and tests (14 affected packages).
  • Independent evidence and proof audit passed, including reversed pipe roles, BOM retention, empty output, and partial EOF parity. Hosted CI and reviews are green, as confirmed by the dispatcher.
  • Direct service transcript after waitForExit: {"output":"X€","truncated":false,"exitStatus":{"exitCode":0,"signal":null}}.

Standard review depth because the fix adds per-stream decoder state. GPT 6.1 Sol and Claude Opus 5.5 found no required changes. Local cubic reported only the additional truncation-coverage note above. Muse Wonder Full 1.0 review was skipped after API 429 reported its subscription quota exhausted. Optional empty-chunk buffer cleanup was deferred as harmless and outside this fix.

Council review on head 7e6492c4a6dd46e9dd7a6493ebf98ed229181330:

Reviewer Score Result
GPT 6.1 Sol 9.5/10 No blocker or should findings
Claude Opus 5.5 9/10 No blocker or should findings

These fresh read-only dispatcher reviews supplement the prior implementation review round above. After Grok 4.7 and backup Muse Wonder Full 1.0 both encountered actual usage-limit failures, Wout explicitly approved: “Use Sol + Opus for this batch.” Neither failed run contributed work or receives model credit.

Implemented, verified, and reviewed by GPT 6.1 Sol through the Codex harness; trimmed and reviewed by Claude Opus 5.5 through the Claude harness, in T3 Code.

StiensWout and others added 3 commits November 7, 2026 09:02
Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT 6.1 Sol <codex@openai.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 7, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 7e6492c

Macroscope's review found this PR approvable — The change preserves UTF-8 characters when terminal stdout and stderr interleave, while retaining literal BOMs. Its scope is limited to buffered output processing, with existing limits, session isolation and process lifecycle unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The terminal output pump now decodes stdout and stderr independently as UTF-8 before buffering. Tests cover split UTF-8 characters across interleaved output and truncation limits measured in encoded bytes.

Changes: Terminal UTF-8 output

Layer / File(s) Summary
Decode terminal output and test byte limits
packages/provider-acp/src/server/clientTerminals.ts, packages/provider-acp/src/server/clientTerminals.test.ts
The output pump decodes stdout and stderr independently while preserving literal BOMs. Tests verify split UTF-8 characters remain intact and truncated output respects encoded-byte limits without replacement characters.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 7e649

No actionable issue is established; the change appears mergeable after normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly describes the UTF-8 fix for interleaved terminal streams.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description clearly explains the problem, change, and verification. It omits the template headings and does not link scope approval or explain why the fix qualifies for an exemption.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0f4a130 and 7e6492c.

Files selected for processing: 2

  • packages/provider-acp/src/server/clientTerminals.test.ts
  • packages/provider-acp/src/server/clientTerminals.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@Yash-Singh1
Yash-Singh1 merged commit 2d0a9df into pingdotgg:main Nov 7, 2026
32 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 7, 2026
**v0.1.8-nightly.20261107.4327** · 23 changes from 8 contributors

- **Remove incomplete ChatGPT connections.** Remove unusable ChatGPT connections directly from the account picker.
- **Delete archived threads.** Delete threads directly from Settings → Archive.
- **Antigravity form questions.** Answer Antigravity’s form questions in chat, including multi-select choices.

### Plus 20 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(azure-devops): default-branch lookup no longer fails for missing --repository by @voltcrash in pingdotgg/t3code#29586
* perf(server): avoid lsof polling when Linux proc is usable by @voltcrash in pingdotgg/t3code#30011
* fix(providers): remove incomplete ChatGPT connections by @voltcrash in pingdotgg/t3code#29280
* fix(acp): retain streamed child tool output by @StiensWout in pingdotgg/t3code#32411
* fix(web): recover ACP settings when projects change by @StiensWout in pingdotgg/t3code#32409
* fix(shared): inline code like `allocator.cc:217` becomes a file chip by @felixlaga in pingdotgg/t3code#32403
* fix(server): theme files saved with a UTF-8 BOM are published instead of rejected by @felixlaga in pingdotgg/t3code#32405
* fix(grok): long command titles no longer end in a broken character by @felixlaga in pingdotgg/t3code#32408
* fix(github): keep review-required until required reviewers approve by @wSedlacek in pingdotgg/t3code#32395
* feat(web): delete archived threads from the archive page by @voltcrash in pingdotgg/t3code#22160
* fix(provider-acp): preserve UTF-8 across interleaved terminal streams by @StiensWout in pingdotgg/t3code#32391
* fix(pi): preserve explicit thinking when switching models by @StiensWout in pingdotgg/t3code#32389
* fix(acp): bound unread raw notification retention by @StiensWout in pingdotgg/t3code#19585
* fix(web): keep Pi thinking controls visible before selection by @voltcrash in pingdotgg/t3code#27397
* fix(desktop): published themes reach the app when it uses this machine's service by @not-compromised in pingdotgg/t3code#26324
* fix(antigravity): check account access after installation by @Yash-Singh1 in pingdotgg/t3code#32446
* fix(acp): preserve native form questions and typed answers by @StiensWout in pingdotgg/t3code#19659
* fix(antigravity): explain missing SOCKS dependency during refresh by @StiensWout in pingdotgg/t3code#19660
* fix(cursor): use the SDK account for usage data by @Yash-Singh1 in pingdotgg/t3code#32448
* fix(web): agent sign-in defaults to Auto access by @flamboh in pingdotgg/t3code#32186
* fix(gitlab): `glab mr accept` counts as a shell merge by @felixlaga in pingdotgg/t3code#32400
* fix(forgejo): tea's `pull` and `m` aliases count as shell merges by @felixlaga in pingdotgg/t3code#32401
* fix: side chats start with the parent's permission mode and reasoning level by @Iweisc in pingdotgg/t3code#32315


**Full Changelog**: pingdotgg/t3code@v0.1.8-nightly.20261107.4314...v0.1.8-nightly.20261107.4327

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.8-nightly.20261107.4327
Pipyakas pushed a commit to Pipyakas/t3code that referenced this pull request Nov 7, 2026
…pingdotgg#32391)

Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2d0a9df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants