@devries-cameron20 / t3code Mirror · read-only / commits / 448c1ac390
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 07:00 UTC

fix(server): create_threads titles no longer end in a broken character (#29163)

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

Alex Southwell committed Nov 3, 2026 at 01:37 UTC 448c1ac390e12d91d4b3ec104479a699136570ab
2 files changed +16 -1
apps/server/src/mcp/OrchestratorMcpService.test.ts
+8
@@ -2149,6 +2149,14 @@ describe("OrchestratorMcpService provider resolution", () => {
2149 ...request,
2150 clientRequestId: "empty",
2151 });
2152 + const emojiAtLimit = yield* service.createThreads(scope, {
2153 + threads: [{ ...request.threads[0]!, prompt: `${"a".repeat(76)}😀 and more work.` }],
2154 + clientRequestId: "emoji-title",
2155 + });
2156 + const titled = yield* orchestrator.getThreadProjection(
2157 + emojiAtLimit.threads[0]!.threadId,
2158 + );
2159 + assert.equal(titled.thread.title, `${"a".repeat(76)}...`);
2160
2161 yield* settings.updateSettings({
2162 projectSettingsOverrides: {
apps/server/src/mcp/OrchestratorMcpService.ts
+8 -1
@@ -746,7 +746,14 @@ function threadTitle(input: {
746 }): string {
747 const detail = input.title?.trim() || input.prompt?.trim();
748 if (!detail) return `${input.parentTitle} thread ${input.index + 1}`;
749 - return detail.length > 80 ? `${detail.slice(0, 77)}...` : detail;
749 + if (detail.length <= 80) return detail;
750 + let end = 77;
751 + const previous = detail.charCodeAt(end - 1);
752 + const next = detail.charCodeAt(end);
753 + if (previous >= 0xd800 && previous <= 0xdbff && next >= 0xdc00 && next <= 0xdfff) {
754 + end -= 1;
755 + }
756 + return `${detail.slice(0, end)}...`;
757 }
758
759 function threadSettlement(