GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): setup script output no longer shows half an emoji where a long line is cut by MarcoDotIO · Pull Request #32217 · pingdotgg/t3code

Conversation

@MarcoDotIO

@MarcoDotIO MarcoDotIO commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Problem

A setup script's output line in the worktree setup card can show a replacement character (�) instead of an emoji. This happens at the end of a line longer than 400 characters, or at the start of a line that follows more than 4096 characters of output with no newline.

Call path: ProjectSetupScriptRunner reads the setup terminal's output and passes each line to onOutputLine. In ThreadLaunchService that callback is WorktreeSetupTracker.appendTail, and the tracker's snapshot goes to the setup card on web, desktop and mobile (WorktreeSetupCard.tsx, worktree-setup-card.tsx). The runner cuts each line with cleaned.slice(0, 400). It also keeps only lineBuffer.slice(-4096) of output with no newline. Both cuts count UTF-16 units. When a cut falls between the two halves of an emoji, one lone surrogate stays in the line, and clients show it as �.

To reproduce, give a project a setup action that runs on worktree creation and waits for it to finish, with the command node -e 'process.stdout.write("🙂".repeat(2100) + "x"); setTimeout(() => process.stdout.write("\n"), 500)' && sleep 90. Start a new thread in a new worktree. The setup card's output line starts with �.

The end-of-line cut has the same split, but on web the card truncates a 400-unit line with an ellipsis long before its end, so only the start-of-line case is visible there. The lone surrogate is still in the line's text either way.

Change

Each cut moves by one unit when it would split a pair. The head cut stops before a trailing high surrogate. The 4096-unit tail starts after a leading low surrogate. The code is inline, like the other merged emoji-cut fixes in the server (#29647, #29633, #29844). The repo has no shared helper for this. The shared truncate trims the text and adds ..., so it does not fit here. The change is two small edits in apps/server/src/project/ProjectSetupScriptRunner.ts and two tests.

Scope and approval

This is a small, focused fix for an obvious bug, so CONTRIBUTING lets it go in without an issue. It belongs to the same family as #26070, #24255 and #29647: a length cap leaves half an emoji. Both cuts affect the same output line on the same path, so they are one problem. Open PR #31882 edits stripTerminalControl in the same file. That is a different line, and the two PRs do not conflict.

User-visible surfaces: the setup card output on web (app.t3.codes and npx t3), desktop and mobile. Only the stray � goes away. A line can now be one unit shorter (399), and the layout stays the same.

Verification

vp test run apps/server/src/project/ProjectSetupScriptRunner.test.ts, with two new cases:

  • "keeps an emoji whole where a long output line is cut": emits x followed by 250 🙂 and expects x followed by 199 🙂.
  • "keeps an emoji whole where newline-free output is bounded": emits 2100 🙂 and x with no newline, then a newline. It expects 200 🙂.

On main with only the test changes, both fail:

× keeps an emoji whole where a long output line is cut
× keeps an emoji whole where newline-free output is bounded
  Received: "x🙂🙂…🙂�"  /  "�🙂🙂…🙂�"
Tests  2 failed | 8 passed (10)

With the fix:

Test Files  1 passed (1)
     Tests  10 passed (10)

vp lint and vp fmt --check on apps/server/src/project pass. effect-tsgo tsrs --noEmit in apps/server reports 0 errors.

Web client, before and after

Web dev server (empty state) with a scratch repo whose Setup action is the reproduction command above, set to run on worktree creation and wait for it to finish. Each shot is a new thread in a new worktree; "before" ran with the fix reverted. The zoomed shots are the same screen at 200% page zoom.

Before: the third output line starts with �. In the DOM the line is 400 units, starting with U+DE42 (a lone low surrogate) and ending with U+D83D (a lone high surrogate).

After: the line starts with a whole emoji; in the DOM it starts and ends with U+1F642.

Not checked: desktop and mobile setup cards (they show the same tracker snapshot). WorktreeSetupTracker.clampText has the same kind of cut for stage details and launch errors. It does not affect these output lines, because the runner already limits them to the tracker's 400-unit cap. This PR does not change it.

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in the Claude Code desktop app.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@MarcoDotIO @claude
fix(server): setup script output no longer shows half an emoji where …
1a986a5
…a long line is cut

The worktree setup card shows at most 400 UTF-16 units of each setup
script output line, and the runner keeps only the last 4096 units of
newline-free output. Both cuts could land inside a surrogate pair, so the
card showed a replacement character at the end or start of the line.
Each cut now steps back or forward one unit to keep the pair whole.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 6, 2026
macroscopeapp[bot]
macroscopeapp Bot approved these changes Nov 6, 2026
View reviewed changes
@macroscopeapp

macroscopeapp Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 1a986a5

Macroscope's review found this PR approvable — Setup-script output truncation now avoids splitting emoji at line and buffer boundaries. The change preserves existing limits and script execution behavior, with risk limited to output presentation.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The runner now preserves complete UTF-16 surrogate pairs when truncating forwarded output at the 400-character limit or retaining the last 4,096 characters of a partial line. Tests cover emoji output in both cases.

Changes: Output truncation

Layer / File(s) Summary
Surrogate-safe truncation and tests
apps/server/src/project/ProjectSetupScriptRunner.ts, apps/server/src/project/ProjectSetupScriptRunner.test.ts
The runner adjusts truncation boundaries to avoid splitting surrogate pairs. Tests verify emoji characters remain whole in long lines and bounded newline-free output.

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

Change: Bug fix

Suggested labels: size:S

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 1a986

The change aims to keep emoji intact when setup output is shortened. No concrete merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly describes the setup script output fix.
Description check Passed The description covers the problem, fix, scope, verification, screenshots, and agent details. It also states which clients were not checked.
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.
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

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: b90e554
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ca242b6-bd64-4051-897f-2581725f2921
Commits

Reviewing files that changed from the base of the PR and between b90e554 and 1a986a5.

Files selected for processing: 2

  • apps/server/src/project/ProjectSetupScriptRunner.test.ts
  • apps/server/src/project/ProjectSetupScriptRunner.ts

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@voltcrash voltcrash mentioned this pull request Nov 11, 2026
fix(shared): preserve Unicode during command output overwrites #34332
Merged
@MarcoDotIO

MarcoDotIO commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of MarcoDotIO

Closing this to save review time. It fixes a real but cosmetic defect, and I'd rather the queue hold fixes with a bigger effect on users. The branch stays on the fork if anyone wants it later.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MarcoDotIO MarcoDotIO closed this Nov 11, 2026
@tiliakoos tiliakoos mentioned this pull request Nov 22, 2026
fix(server): setup script output no longer ends in half an emoji #40701
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@MarcoDotIO
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.