@devries-cameron20 / t3code-1 / commits / 3ca53a983b
Fork 0

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

fix(server): agents read RTF paragraphs that end with a backslash (#30848)

Co-authored-by: Geezy <igor.licko@gloryck.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

TheGuyWithHAT committed Nov 6, 2026 at 05:39 UTC 3ca53a983bb7ea0c1d40d10f5fb2f013add6dbe1
2 files changed +3
apps/server/src/provider/documentTextWorker.ts
+2
@@ -409,6 +409,8 @@ function* rtf(source: string): Generator<string, void> {
409 i++;
410 if (fallback) fallback--;
411 else if (rest[0] === "*") state.skip = true;
412 + // A backslash before a line break is \par; TextEdit ends paragraphs this way.
413 + else if (!state.skip && (rest[0] === "\n" || rest[0] === "\r")) yield "\n";
414 else if (!state.skip && ["\\", "{", "}"].includes(rest[0]!)) yield rest[0]!;
415 else if (!state.skip && symbols.has(rest[0]!)) yield symbols.get(rest[0]!)!;
416 }
apps/server/src/provider/userInputAttachments.test.ts
+1
@@ -182,6 +182,7 @@ describe("question answer paths", () => {
182 ],
183 ["hyphen symbol fallback", String.raw`{\rtf1\ansi\uc3\u945\~\_\-Z}`, "αZ"],
184 ["control word", String.raw`{\rtf1\ansi A\u9\tab X}`, "A\tX"],
185 + ["line break paragraphs", "{\\rtf1\\ansi First\\\nSecond\\\r\nThird}", "First\nSecond\nThird"],
186 ["group close", String.raw`{\rtf1\ansi{\u945}Z}`, "αZ"],
187 ["group open", String.raw`{\rtf1\ansi\u945{Z}}`, "αZ"],
188 ["hex byte", String.raw`{\rtf1\ansi\u945\'3fZ}`, "αZ"],