From 7461e27a330d8ec654787ce8722650a2ec85db74 Mon Sep 17 00:00:00 2001 From: Valerii Kovalskii Date: Tue, 7 Apr 2026 20:21:52 +0300 Subject: [PATCH] fix: detail panel 840px, LLM prompt with XML structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Detail panel default width 700px → 840px - LLM prompt restructured with and tags - System prompt separated from user content for clearer model behavior Co-Authored-By: Claude Opus 4.6 (1M context) --- src/frontend/styles.css | 2 +- src/server.js | 39 ++++++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/frontend/styles.css b/src/frontend/styles.css index 8b38066..860448b 100644 --- a/src/frontend/styles.css +++ b/src/frontend/styles.css @@ -730,7 +730,7 @@ body { position: fixed; top: 0; right: 0; - width: 700px; + width: 840px; min-width: 400px; max-width: 90vw; height: 100vh; diff --git a/src/server.js b/src/server.js index e35865d..99ce43a 100644 --- a/src/server.js +++ b/src/server.js @@ -466,29 +466,34 @@ function saveLLMConfig(config) { function callLLM(config, conversation, totalMessages) { return new Promise((resolve, reject) => { - const prompt = `Below is a coding session (first and last messages from ${totalMessages} total). + const systemPrompt = ` +You are a coding session summarizer. You read coding conversations and produce a single short concrete title describing what was done. + + + +- Write 5-15 words summarizing WHAT was concretely done +- Mention specific: technologies, files, features, bugs, configs +- Write in the SAME language the user used in the conversation +- Never write vague/generic descriptions +- Respond ONLY with JSON: {"title": "your summary"} + +GOOD: "Фикс авторизации OAuth + рефактор middleware" +GOOD: "Добавил Cursor сессии, cmux терминал, WSL поддержку" +GOOD: "Настройка nginx reverse proxy для staging" +GOOD: "Fix Codex message count bug in grid view" +BAD: "Coding session about project" — too vague +BAD: "Bug fix and improvements" — no specifics +BAD: "Working with code" — meaningless +`; + + const prompt = `Coding session: ${totalMessages} messages total. First and last messages below. -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}`; const body = JSON.stringify({ model: config.model, messages: [ - { role: 'system', content: 'Write a short concrete summary of what was done. Respond ONLY with JSON: {"title": "your summary here"}' }, + { role: 'system', content: systemPrompt }, { role: 'user', content: prompt }, ], response_format: { type: 'json_object' },