GeezerVison is showing github.com — fix(server): long worktree setup details no longer end in half an emoji by only21mil · Pull Request #41629 · pingdotgg/t3code
Conversation
Problem
The worktree setup card can show a stray replacement character (�) right before the … of a cut-off line. The server's WorktreeSetupTracker caps a stage's detail at 200 UTF-16 code units and the failure error at 1000 by slicing at maxLength - 1. When an emoji or another non-BMP character sits on that boundary, the cut keeps only its first half. Both texts can carry user paths: a submodule's path comes from git's output, and a failed setup's error includes the project folder and git's stderr. The client then receives a lone surrogate. The web and mobile cards show the error in full, so the broken character is visible there.
#40701 fixed the same cut in ProjectSetupScriptRunner but left this helper alone.
Change
clampText in WorktreeSetupTracker.ts now uses the same splitsSurrogatePair check as #40701 and stops one code unit earlier when the cut would split a pair. The result still fits the contract's limit. Stage details, setup output lines and the failure error all go through this one helper. One test is added to WorktreeSetupTracker.test.ts.
Verification
An AI agent ran each check on Linux with no accounts.
Setup: Linux x86_64, Node 26.13.1, git 2.53.0, a throwaway repository in a temp folder.
Steps: a small script that runs real git and passes its output through the same steps the server uses, into a real WorktreeSetupTracker, then reads the snapshot back through JSON the way the WebSocket sends it.
- The submodule-path detail comes from
git submodule update --init --progress, with the submodule at a 206-unit path that has 🚀 at units 198–199.
- The failure error comes from a
git worktree add that fails into an existing folder named 🚀 release. Its stderr is wrapped the way GitCommandError and the launch failure do, giving 1024 units with 🚀 at 998–999.
|
e86a9c51696d (main) |
005abe037809 (this PR) |
| Stage detail (200) |
…ee\ud83d…, well-formed: false |
…eee…, well-formed: true |
| Failure error (1000) |
…y/\ud83d…, well-formed: false |
…yy/…, well-formed: true |
vp test run src/project/WorktreeSetupTracker.test.ts: the new case fails on main (\ud83d before …) and passes here (6/6).
vp run check:changed: passes.
Generated with Gemini 4 Neon in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 005abe0 and 3a045a0.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review.
Walkthrough
-
WorktreeSetupTracker now avoids splitting a UTF-16 surrogate pair when it truncates text. A test checks the behavior for stage details and finish errors.
Changes: Surrogate-safe text truncation
| Layer / File(s) |
Summary |
Safe clamping and tests apps/server/src/project/WorktreeSetupTracker.ts, apps/server/src/project/WorktreeSetupTracker.test.ts |
clampText moves the truncation boundary back one code unit when it would split a surrogate pair. Tests check truncated stage details and finish errors. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested labels: bugfix
Suggested reviewers: macroscopeapp, juliusmarminge
Merge Risk: Minimal · previous review 005ab
-
This change prevents truncated setup text from ending with a broken character before the ellipsis. The change is small and tested, and no merge-blocking risk remains.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the fix (a truncated worktree setup detail no longer ends in a broken surrogate character) and the component (server). It matches the main change in WorktreeSetupTracker's clampText, s… |
| Description check |
 |
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the lone surrogate and the replacement character, with the expected behavio… |
| 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. |
Full details: Title check
-
Explanation
The title names the fix (a truncated worktree setup detail no longer ends in a broken surrogate character) and the component (server). It matches the main change in WorktreeSetupTracker's clampText, so it passes. It is conventional-commit style and specific. The phrase 'half an emoji' is informal but still accurate.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the lone surrogate and the replacement character, with the expected behavior. The Change section explains the clampText update and the shared helper, and it cites the related PR #40701. The Scope section is missing. It does not link an issue that shows the bug, and it does not say why no issue is needed. The Verification section is strong. It lists the environment, steps, before and after results, and the test run. It also names the model and harness used, as the template asks. The template asks for an agent's model and harness, and the author gives 'Gemini 4 Neon in T3 Code Nightly', so that requirement is met.
Resolution
Add a Scope section. Link the issue that shows the bug, or explain in one sentence why this small obvious fix needs no issue.
Finishing Touches
-
Generate unit tests (beta)
-
- 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 0fd87d3 and 005abe0.
Files selected for processing: 2
-
apps/server/src/project/WorktreeSetupTracker.test.ts
apps/server/src/project/WorktreeSetupTracker.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Created the reported 204-unit submodule path, configured an automatic blocking Slow setup action, and started a Replay thread in a new worktree on both commits. Captured Init submodules while setup ran. Both captures use Chromium, 1280×800, light theme, fresh synthetic state, and identical RTL/outline/enlargement to reveal the normally clipped tail; terminal output is hidden for privacy.
Proven: the scenario fails on base and passes on head. The base renders a replacement glyph and its detail is not well-formed Unicode. The head truncates cleanly, ends with an ellipsis, and stays within 200 UTF-16 units.
Scenario source.
Not shown:
- The 1000-unit failed-worktree error path was not exercised; this proof covers the reported 200-unit submodule setup detail path.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 23, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
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.
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.
|