Browse Source

tweak: split out title before newline

Aiden Cline 4 months ago
parent
commit
913c3ae799
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/opencode/src/session/prompt.ts

+ 1 - 1
packages/opencode/src/session/prompt.ts

@@ -1902,7 +1902,7 @@ export namespace SessionPrompt {
       .then((result) => {
       .then((result) => {
         if (result.text)
         if (result.text)
           return Session.update(input.session.id, (draft) => {
           return Session.update(input.session.id, (draft) => {
-            const cleaned = result.text.replace(/<think>[\s\S]*?<\/think>\s*/g, "")
+            const cleaned = result.text.replace(/<think>[\s\S]*?<\/think>\s*/g, "").split("\n")[0]
             const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
             const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
             draft.title = title.trim()
             draft.title = title.trim()
           })
           })