From 99bb3526dbb2563cc5edd53947e0a095361db79e Mon Sep 17 00:00:00 2001 From: claude Date: Sun, 2 Aug 2026 10:01:58 +0400 Subject: [PATCH] Stop asking for Russian in English on the last three prompts (V-404) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #400 rewrote the chat and query prompts in Russian and left three pieces of English prose behind. PhraseReminder's user prompt was fully English. It is Russian now, and it no longer restates the JSON contract or the persona rules: the call goes through chat(), so nudgeSystem already states both, and a second copy of a contract is one more thing that can drift out of step with the first. querySystemPrompt and router.KnowledgePrompt both closed with the English "Respond ONLY with valid JSON:". That sentence is prose instruction, not wire format — the JSON skeleton after it is the wire format, and it is unchanged. Kept rather than deleted: the GBNF grammar makes it close to redundant, but the grammar is switchable off (phraser NoGrammar), and the sentence is the floor when it is. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_018CotYKycuio1GwLbYh9jfc --- internal/phraser/llmphraser.go | 10 ++++++++-- internal/router/knowledge.go | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/phraser/llmphraser.go b/internal/phraser/llmphraser.go index fd34770..c82d45e 100644 --- a/internal/phraser/llmphraser.go +++ b/internal/phraser/llmphraser.go @@ -534,8 +534,14 @@ func (p *LLMPhraser) PhraseReminder(ctx context.Context, d loop.ReminderDecision text = "reminder" } + // Russian, like the other two prompts (Vikunja #404). Asking a model for a + // Russian reply in English is asking it to switch languages mid-prompt, + // and a 1.7B sometimes answers in the language it was asked in. The + // persona rules and the JSON contract are not repeated here: this call + // goes through chat(), so nudgeSystem already states both, and a second + // statement of the same contract is one more thing that can drift. prompt := fmt.Sprintf( - `The user set a reminder: "%s". Rephrase it briefly as a gentle nudge. Respond as JSON: {"response": "...", "mood": "..."}`, + `Он поставил напоминание: "%s". Скажи это своими словами, коротко и мягко — одно предложение.`, text, ) resp, err := p.chat(ctx, prompt) @@ -754,7 +760,7 @@ func (p *LLMPhraser) querySystemPrompt() string { base := "Ты отвечаешь ему по источникам, которые тебе дали. Отвечай ТОЛЬКО по ним: всё, что ты говоришь, должно быть написано в источниках. " + "Если ответа в них нет — так и скажи и на этом остановись; не добавляй ничего из своих знаний и не догадывайся. " + "Не приплетай прошлые реплики разговора. " + - "Отвечай по-русски, коротко и своими словами, начинай с \"вот что я нашла: \". О себе — в женском роде, глаголы в прошедшем времени с окончанием -ла. Он мужчина, обращайся к нему на \"ты\". Respond ONLY with valid JSON: {\"response\": \"...\", \"mood\": \"neutral\"}." + "Отвечай по-русски, коротко и своими словами, начинай с \"вот что я нашла: \". О себе — в женском роде, глаголы в прошедшем времени с окончанием -ла. Он мужчина, обращайся к нему на \"ты\". Отвечай ТОЛЬКО одним объектом JSON: {\"response\": \"...\", \"mood\": \"neutral\"}." return persona.Prepend(p.cfg.ContextBlock, base) } diff --git a/internal/router/knowledge.go b/internal/router/knowledge.go index d425e95..0d3d7cc 100644 --- a/internal/router/knowledge.go +++ b/internal/router/knowledge.go @@ -6,5 +6,5 @@ func KnowledgePrompt() string { // No self-introduction here: the shared persona block already says who she // is, and this line used to disagree with it — a different name ("Мавена") // and a masculine noun ("ассистент") in front of a feminine persona. - return `Ответь кратко из своих знаний. Если не знаешь — скажи "не знаю". Не выдумывай. Respond ONLY with valid JSON: {"response": "...", "mood": "neutral"}.` + return `Ответь кратко из своих знаний. Если не знаешь — скажи "не знаю". Не выдумывай. Отвечай ТОЛЬКО одним объектом JSON: {"response": "...", "mood": "neutral"}.` }