From 7be0fd0d88f7e867751693d04e50efb13c9123c9 Mon Sep 17 00:00:00 2001 From: Valerii Kovalskii Date: Tue, 7 Apr 2026 20:19:42 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20improve=20LLM=20title=20prompt=20?= =?UTF-8?q?=E2=80=94=20concrete=20descriptions=20instead=20of=20vague=20ti?= =?UTF-8?q?tles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Prompt now asks for specific summary: technologies, files, features, bugs - Good/bad examples in the prompt to guide the model - Writes in user's language (Russian/English) - max_tokens 100 → 150 for longer descriptions Co-Authored-By: Claude Opus 4.6 (1M context) --- src/server.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/server.js b/src/server.js index 2024bd8..e35865d 100644 --- a/src/server.js +++ b/src/server.js @@ -466,9 +466,21 @@ function saveLLMConfig(config) { function callLLM(config, conversation, totalMessages) { return new Promise((resolve, reject) => { - const prompt = `You are a helpful assistant that generates concise session titles. + const prompt = `Below is a coding session (first and last messages from ${totalMessages} total). -Given a coding session conversation (first and last messages from ${totalMessages} total), generate a short descriptive title (3-8 words) that captures the main topic/task. +Write a SHORT summary (5-15 words) of what was CONCRETELY done in this session. Be specific: mention technologies, files, features, bugs — not vague descriptions. Write in the same language the user used. + +Good examples: +- "Фикс авторизации через OAuth + рефактор middleware" +- "Добавил поддержку Cursor сессий и cmux терминала" +- "Настройка nginx reverse proxy для staging сервера" +- "Fix Codex message count bug in grid view" +- "Docker compose setup for multi-agent dashboard" + +Bad examples (too vague): +- "Coding session about project setup" +- "Bug fix and improvements" +- "Working with code" Conversation: ${conversation}`; @@ -476,11 +488,11 @@ ${conversation}`; const body = JSON.stringify({ model: config.model, messages: [ - { role: 'system', content: 'Generate a concise title for this coding session. Respond with JSON: {"title": "your title here"}' }, + { role: 'system', content: 'Write a short concrete summary of what was done. Respond ONLY with JSON: {"title": "your summary here"}' }, { role: 'user', content: prompt }, ], response_format: { type: 'json_object' }, - max_tokens: 100, + max_tokens: 150, temperature: 0.3, });