From 8eef0c435dd2b5eade745960b274757603553009 Mon Sep 17 00:00:00 2001 From: Ali Aliev Date: Fri, 1 May 2026 17:07:22 +0300 Subject: [PATCH] Preserve language in generated thread titles --- apps/server/src/git/Prompts.test.ts | 8 ++++++++ apps/server/src/git/Prompts.ts | 1 + 2 files changed, 9 insertions(+) diff --git a/apps/server/src/git/Prompts.test.ts b/apps/server/src/git/Prompts.test.ts index d8d079c0cf..6311552ad5 100644 --- a/apps/server/src/git/Prompts.test.ts +++ b/apps/server/src/git/Prompts.test.ts @@ -115,6 +115,14 @@ describe("buildThreadTitlePrompt", () => { expect(result.prompt).not.toContain("Attachment metadata:"); }); + it("instructs title generation to preserve the user's language", () => { + const result = buildThreadTitlePrompt({ + message: "Investigate inconsistent generated chat title language", + }); + + expect(result.prompt).toContain("Use the user's language; do not translate."); + }); + it("includes attachment metadata when attachments are provided", () => { const result = buildThreadTitlePrompt({ message: "Name this thread from the screenshot", diff --git a/apps/server/src/git/Prompts.ts b/apps/server/src/git/Prompts.ts index 4092358825..77fdf77749 100644 --- a/apps/server/src/git/Prompts.ts +++ b/apps/server/src/git/Prompts.ts @@ -188,6 +188,7 @@ export function buildThreadTitlePrompt(input: ThreadTitlePromptInput) { rules: [ "Title should summarize the user's request, not restate it verbatim.", "Keep it short and specific (3-8 words).", + "Use the user's language; do not translate.", "Avoid quotes, filler, prefixes, and trailing punctuation.", "If images are attached, use them as primary context for visual/UI issues.", ],