Skip to content

Commit ad8a4bc

Browse files
authored
fix: strip thinking blocks from title (anomalyco#1325)
1 parent 2630104 commit ad8a4bc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/opencode/src/session/index.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,9 @@ export namespace Session {
640640
.then((result) => {
641641
if (result.text)
642642
return Session.update(input.sessionID, (draft) => {
643-
draft.title = result.text
643+
const cleaned = result.text.replace(/<think>[\s\S]*?<\/think>\s*/g, "")
644+
const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
645+
draft.title = title
644646
})
645647
})
646648
.catch(() => {})

0 commit comments

Comments
 (0)