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
fix: move reasoning token budget floor to OpenAI provider
Keep titleMaxTokens at 20 for non-reasoning models. The OpenAI client
now enforces a minimum output-token budget (256) only when NoThinking
is set on a reasoning model, where hidden reasoning tokens would
otherwise starve the visible text.
Copy file name to clipboardExpand all lines: pkg/sessiontitle/generator.go
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ const (
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
24
// titleMaxTokens is the max output token budget for title generation.
25
-
// This must be large enough for reasoning models (o-series, gpt-5) where
26
-
// max_output_tokens includes hidden reasoning tokens. With minimal
27
-
// reasoning effort a short title needs ~200-250 tokens total.
28
-
titleMaxTokens=256
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
29
30
30
// titleGenerationTimeout is the maximum time to wait for title generation.
31
-
// Title generation should be quick since we use minimal thinking and a
32
-
// small token budget. If the API is slow or hanging, we should timeout.
31
+
// Title generation should be quick since we disable thinking and use low max_tokens.
32
+
// If the API is slow or hanging (e.g., due to server-side thinking), we should timeout.
0 commit comments