fix(chat): the conversation picker reads as the panel's title, and titles name the subject, not the mood
deploy / plan (push) Successful in 9s
ci/woodpecker/push/deploy Pipeline was successful
deploy / gate (push) Successful in 7m24s
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 38s
deploy / plan (push) Successful in 9s
ci/woodpecker/push/deploy Pipeline was successful
deploy / gate (push) Successful in 7m24s
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 38s
This commit is contained in:
2 files changed
+10
-6
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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))"
|
||||
>
|
||||
<SelectTrigger size="sm" class="w-full" aria-label="Conversation">
|
||||
<span class="flex min-w-0 items-center gap-1.5"><span class="text-fg-muted">Conversation</span><SelectValue placeholder="None yet" /></span>
|
||||
<SelectTrigger size="sm" class="w-full border-0 bg-transparent px-1.5 font-medium shadow-none hover:bg-muted" aria-label="Conversation">
|
||||
<span class="flex min-w-0 items-center gap-1.5"><History class="size-3.5 shrink-0 text-fg-muted" aria-hidden="true" /><SelectValue placeholder="No conversations yet" /></span>
|
||||
</SelectTrigger>
|
||||
<SelectContent position="popper">
|
||||
<SelectGroup>
|
||||
|
||||
Reference in new issue
Block a user