on main help sign in
fix: remove <think></think> from title
3694768Carlos Alexandro Becker
internal/llm/agent/agent.go+7−1
@@ -326,7 +326,13 @@ func (a *agent) generateTitle(ctx context.Context, sessionID string, content str
326 return fmt.Errorf("no response received from title provider")
326 return fmt.Errorf("no response received from title provider")
327 }
327 }
328
328
329− title := strings.TrimSpace(strings.ReplaceAll(finalResponse.Content, "\n", " "))
329+ title := strings.ReplaceAll(finalResponse.Content, "\n", " ")
330+
331+ if idx := strings.Index(title, "</think>"); idx > 0 {
332+ title = title[idx+len("</think>"):]
333+ }
334+
335+ title = strings.TrimSpace(title)
330 if title == "" {
336 if title == "" {
331 return nil
337 return nil
332 }
338 }