You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/sessiontitle/generator.go
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,12 @@ const (
21
21
systemPrompt="You are a helpful AI assistant that generates concise, descriptive titles for conversations. You will be given up to 2 recent user messages and asked to create a single-line title that captures the main topic. Never use newlines or line breaks in your response."
22
22
userPromptFormat="Based on the following recent user messages from a conversation with an AI assistant, generate a short, descriptive title (maximum 50 characters) that captures the main topic or purpose of the conversation. Return ONLY the title text on a single line, nothing else. Do not include any newlines, explanations, or formatting.\n\nRecent user messages:\n%s\n\n"
23
23
24
+
// titleMaxTokens is the max output token budget for title generation.
25
+
// This is sized for visible output only (~50 chars ≈ 12-15 tokens).
26
+
// Providers that need extra headroom for hidden reasoning tokens
27
+
// (e.g. OpenAI reasoning models) handle the adjustment internally.
28
+
titleMaxTokens=20
29
+
24
30
// titleGenerationTimeout is the maximum time to wait for title generation.
25
31
// Title generation should be quick since we disable thinking and use low max_tokens.
26
32
// If the API is slow or hanging (e.g., due to server-side thinking), we should timeout.
0 commit comments