on main help sign in
fix: remove <think></think> from title

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

commit36947685bd6c205bf1c95cc68f1ee0c392b44a24 authorCarlos Alexandro Becker <caarlos0@users.noreply.github.com> dateFri 19 Sep 2025, 15:07 (1 year ago) parent36b053b
1 file changed+7−1
internal/llm/agent/agent.go+7−1
internal/llm/agent/agent.go+7−1
@@ -326,7 +326,13 @@ func (a *agent) generateTitle(ctx context.Context, sessionID string, content str
326326 return fmt.Errorf("no response received from title provider")
327327 }
328328
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)
330336 if title == "" {
331337 return nil
332338 }