diff --git a/internal/gateway/session_titles.go b/internal/gateway/session_titles.go index 0ee897e6d..b926b4a6c 100644 --- a/internal/gateway/session_titles.go +++ b/internal/gateway/session_titles.go @@ -20,12 +20,14 @@ type TitleGenerator interface { // still normalised by cleanGeneratedTitle before it is persisted. const TitleGenerationSystemPrompt = `You write short titles for conversation logs. -Given the first user message of a new conversation, write a title for the +Given a user message from a new conversation, write a title for the conversation. Requirements: - 3 to 6 words, under 60 characters -- Name the topic, not a summary of the message +- Name the subject: the system, task, error or goal the message is about +- Never describe the user's mood or tone - No quotes, no bullet, no trailing period -- Reply with the title only, nothing else` +- Reply with the title only, nothing else +- If the message names no subject (an exclamation, a greeting), reply NONE` // maxTitleRunes caps how long a generated session title may be. Titles // stay short enough to render on one line in a chat bubble. @@ -84,8 +86,9 @@ func (r *Router) generateTitle(ctx context.Context, sessionID, firstMessage stri if err != nil { return } + // NONE leaves the session untitled, so the next turn's message is asked. title = cleanGeneratedTitle(title) - if title == "" { + if title == "" || strings.EqualFold(title, "none") { return } // Re-read so a manual /title made meanwhile wins. diff --git a/ui/src/chat/ChatSessionList.vue b/ui/src/chat/ChatSessionList.vue index b38dcade7..eff73afda 100644 --- a/ui/src/chat/ChatSessionList.vue +++ b/ui/src/chat/ChatSessionList.vue @@ -7,6 +7,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { History } from "@lucide/vue"; import { sessionTitle } from "./session"; import { currentSession, selectSession, sessions } from "./state"; @@ -28,8 +29,8 @@ import { currentSession, selectSession, sessions } from "./state"; :disabled="!sessions.length" @update:model-value="selectSession(String($event))" > - - Conversation + +