@devries-cameron20 / t3code-1 / commits / bbaa535fa4
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): restart notes no longer split an emoji in a long background task label (#29647)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Alex Southwell committed Nov 3, 2026 at 23:09 UTC bbaa535fa4d7c0aa6a35a051d1ff3025c3a9a2be
2 files changed +12 -1
apps/server/src/orchestration-v2/RestartBackgroundNote.test.ts
+7
@@ -113,6 +113,13 @@ it("names a lost subagent by the id the agent resumes it with", () => {
113 parentTaskId: "a".repeat(400),
114 }).label;
115 assert.lengthOf(longId, 160);
116 + assert.isTrue(
117 + cancelledRosterTaskWork({
118 + kind: "command",
119 + taskId: "shell-1",
120 + description: `${"d".repeat(158)}🚀 deploy`,
121 + }).label.isWellFormed(),
122 + );
123 assert.isFalse(isAwaitedWork(cancelledRosterTaskWork({ kind: "command", taskId: "shell-2" })));
124 assert.isTrue(
125 isAwaitedWork(cancelledRosterTaskWork({ kind: "command", taskId: "tests", awaited: true })),
apps/server/src/orchestration-v2/RestartBackgroundNote.ts
+5 -1
@@ -17,7 +17,11 @@ function compactLabel(value: unknown, maxLength = MAX_LABEL_LENGTH): string | un
17 if (typeof value !== "string") return undefined;
18 const text = value.replaceAll(/\s+/g, " ").trim();
19 if (text.length === 0) return undefined;
20 - return text.length > maxLength ? `${text.slice(0, maxLength - 1)}…` : text;
20 + if (text.length <= maxLength) return text;
21 + // Half an emoji serializes to a lone surrogate escape, which provider JSON parsers reject.
22 + const last = text.charCodeAt(maxLength - 2);
23 + const end = last >= 0xd800 && last <= 0xdbff ? maxLength - 2 : maxLength - 1;
24 + return `${text.slice(0, end)}…`;
25 }
26
27 /** A bounded label that keeps its id suffix whole whenever it fits. */