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 21, 09:45 UTC
fix(provider-core): generated thread titles keep the closing quote of a quoted term (#37499)
Co-authored-by: MarcoDotIO <20867620+MarcoDotIO@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
tiliakoos committed
Nov 16, 2026 at 01:22 UTC
f083f26cd5a848b592aed918269082500a6f3129
2 files changed
+12
-1
packages/provider-core/src/server/textGenerationUtils.test.ts
+11
@@ -22,6 +22,17 @@ describe("sanitizeCommitSubject", () => {
22
});
23
24
describe("sanitizeThreadTitle", () => {
25
+ it.each([
26
+ { raw: '"Fix login redirect"', expected: "Fix login redirect" },
27
+ { raw: `"Fix user's login"`, expected: "Fix user's login" },
28
+ { raw: "Explain `vp check`", expected: "Explain `vp check`" },
29
+ { raw: '"Open in" menu ignores Finder', expected: '"Open in" menu ignores Finder' },
30
+ { raw: 'Rename "foo" to "bar"', expected: 'Rename "foo" to "bar"' },
31
+ { raw: '"Open in" ignores "Finder"', expected: '"Open in" ignores "Finder"' },
32
+ ])("unwraps only a quote pair around the whole title: $raw", ({ raw, expected }) => {
33
+ expect(sanitizeThreadTitle(raw)).toBe(expected);
34
+ });
35
+
36
it.each([
37
{ name: "a split surrogate pair", prefixLength: 116, character: "🚀", retained: "" },
38
{ name: "a complete surrogate pair", prefixLength: 115, character: "🚀", retained: "🚀" },
packages/provider-core/src/server/textGenerationUtils.ts
+1
-1
@@ -64,7 +64,7 @@ export function sanitizeThreadTitle(raw: string): string {
64
.trim()
65
.split(/\r?\n/g)[0]
66
?.trim()
67
- .replace(/^['"`]+|['"`]+$/g, "")
67
+ .replace(/^(['"`])((?:(?!\1).)*)\1$/, "$2")
68
.trim()
69
.replace(/\s+/g, " ");
70