Repository navigation
fix(server): git action toast descriptions no longer end in half an emoji - #43344
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
… test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceReal-app proof for #43344: the scenario failed on base and passed on head. Environment: Linux Chromium, light theme, 1920×1080, separate checkouts and fresh databases, synthetic project/thread using Replay (dev). Generated subjects came from a deterministic local model API through the real adapter. Capture-only CSS wraps the app’s existing status paragraphs identically on both sides; it changes no text and adds no overlay. Steps: commit a README change with a hook emitting 499 a + 😀bbbb and a message of 68 a + 😀bbbb. Capture hook output and completion. Repeat with 67 a + 😀bbbb to preserve the complete emoji. Then auto-generate subjects from 71 a + 😀bb, a 72-unit malformed response ending in a high surrogate, and a high-surrogate-only response to exercise the empty-result fallback.
Before recording · After recording · Scenario and seed driver Both recordings end with the final committed row still visible. The valid generated-subject control is already safe on base because the shared adapter truncates by grapheme before GitManager sees it. The malformed 72-unit response and single-surrogate response exercise the changed GitManager cleanup and fallback respectively. Not shown:
|
包含上游提交: - pingdotgg#43318 (8ec9f43) 含三个反引号代码块后的线程链接正常渲染 - pingdotgg#43342 (6ea8886) 截断的颜色码不再残留字符到命令输出 - pingdotgg#43337 (fc1f1ba) Web Notebook 预览显示仅含 text/markdown 的输出 - pingdotgg#43331 (3fa136a) 分块 Markdown 预览保留 ... frontmatter 后的链接定义 - pingdotgg#43360 (65fc371) 文件侧栏支持复制文件路径 - pingdotgg#43358 (7891c72) 聊天表格复制为 CSV 在换行处保留空格 - pingdotgg#43344 (2a99314) Git 操作 toast 描述截断不再出现半个 emoji - pingdotgg#43357 (5fda4f7) agent auto 发送 steer 绕过显式队列 - pingdotgg#43380 (147028a) ACP 可选布尔和选择题允许跳过 - pingdotgg#43383 (6ac4ede) 设置页快捷键胶囊按平台渲染修饰键和键名
…moji (pingdotgg#43344) Co-authored-by: SAPHID <saphid@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> (cherry picked from commit 2a99314)
…moji (pingdotgg#43344) Co-authored-by: SAPHID <saphid@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> (cherry picked from commit 2a99314)
…moji (pingdotgg#43344) Co-authored-by: SAPHID <saphid@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> (cherry picked from commit 2a99314)
…moji (pingdotgg#43344) Co-authored-by: SAPHID <saphid@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> (cherry picked from commit 2a99314)












Problem
Git action completion toast descriptions (
truncateText, 72-character cap), generated commit subjects (sanitizeCommitMessage, 72-character cap), and commit hook progress lines (sanitizeProgressText, 500-character cap) inapps/server/src/git/GitManager.tsslice raw UTF-16 code units. When a typedcommitMessage, generated commit subject, PR title, or hook output line has a supplementary-plane emoji straddling the cut boundary, the sliced string ends in a lone high surrogate (\ud83d), which encodes as UTF-8ef bf bd(U+FFFD, replacement character).Deterministic repro on
origin/main(25525f948351757535decaaf8de43e952a7865b1):GitManager.runStackedAction(action: "commit") withcommitMessageset to"a".repeat(68) + "😀" + "bbbb"(length 74,😀at UTF-16 indices 68–69 straddling72 - 3 = 69), or with apre-commithook printing"a".repeat(499) + "😀" + "bbbb"(straddling index 500), or with a generated subject"a".repeat(71) + "😀" + "bb"(straddling index 72).toast.descriptionis"a".repeat(68) + "\ud83d..."(isWellFormed() === false, trailing UTF-8 bytesef bf bd 2e 2e 2e), thehook_outputevent ends in\ud83d(ef bf bd), andsanitizeCommitMessagereturns"a".repeat(71) + "\ud83d"(isWellFormed() === false).toast.descriptionis"a".repeat(68) + "...", thehook_outputline is"a".repeat(499), and the generated commit subject is"a".repeat(71)—all well-formed (isWellFormed() === true) with the straddling emoji dropped rather than split.Change
Drop any trailing lone high surrogate (
[\uD800-\uDBFF]$) before.trimEnd()after slicing intruncateText,sanitizeCommitMessage, andsanitizeProgressTextinapps/server/src/git/GitManager.ts. Web (apps/web/src/components/GitActionsControl.tsx), desktop (wraps web), and mobile (apps/mobile/src/state/use-selected-thread-git-actions.ts) rendertoast.descriptiondirectly from this server payload without re-truncating, so fixing the server covers all client surfaces.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
origin/main): The regression test inapps/server/src/git/GitManager.test.tsfailed on unmodifiedorigin/mainwithactual: "a".repeat(68) + "\ud83d..."instead of"a".repeat(68) + "...", and the runtime transcript againstorigin/main(25525f948351757535decaaf8de43e952a7865b1) confirmedisWellFormed() === falseand trailingef bf bd(U+FFFD) bytes in all three functions.hunter/c-400ca16360):vp test run apps/server/src/git/GitManager.test.ts -t "truncates commit subjects, toast descriptions, and hook output without splitting an emoji"passed 3/3 consecutive runs, confirming split surrogates are dropped in completion toast descriptions, generated commit subjects, andhook_outputprogress lines while a whole emoji ending at index 69 (67×a + 😀 + bbbb) is preserved intact.vp run check:changed: Exited0on1a05208801ac(format, lint, knip, graphql, typecheck across 3 packages, and 172/172 affected tests passing).Authored by Gemini 4 Neon (Antigravity); reviewed by Claude Opus 5.5 (Model Hub).