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, 02:00 UTC
fix(grok): long command titles no longer end in a broken character (#32408)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Felix Laga committed
Nov 7, 2026 at 19:45 UTC
a9752171080f264c7df6a979425d4dc2448a85b8
2 files changed
+16
-1
packages/provider-grok/src/server/xaiAcpExtension.test.ts
+12
@@ -458,6 +458,18 @@ describe("XAiAcpExtension", () => {
458
const normalized = normalizeXAiAcpToolCallState(toolCall);
459
expect(normalized.status).toBe("completed");
460
expect(normalized.title).toBe("for i in 1 2; do echo STREAM_$i; done; echo STREAM_DONE");
461
+ expect(
462
+ normalizeXAiAcpToolCallState({
463
+ ...toolCall,
464
+ data: {
465
+ ...toolCall.data,
466
+ rawOutput: {
467
+ ...toolCall.data.rawOutput,
468
+ command: `git commit -m "${"x".repeat(61)}🎉 ship it"`,
469
+ },
470
+ },
471
+ }).title,
472
+ ).toBe(`git commit -m "${"x".repeat(61)}...`);
473
expect(
474
normalizeXAiAcpToolCallState({
475
...toolCall,
packages/provider-grok/src/server/xaiAcpExtension.ts
+4
-1
@@ -549,7 +549,10 @@ function resolveXAiAcpToolTitle(toolCall: AcpToolCallState): string | undefined
549
nonEmptyString(rawInput?.command) ??
550
nonEmptyString(unknownRecord(toolCall.data.rawOutput)?.command);
551
if (command !== undefined) {
552
- return command.length > 80 ? `${command.slice(0, 77)}...` : command;
552
+ if (command.length <= 80) return command;
553
+ const splitsPair =
554
+ /[\uD800-\uDBFF]/.test(command.charAt(76)) && /[\uDC00-\uDFFF]/.test(command.charAt(77));
555
+ return `${command.slice(0, splitsPair ? 76 : 77)}...`;
556
}
557
return nonEmptyString(toolCall.title);
558
}