mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
fix: strip thinking blocks from title (#1325)
This commit is contained in:
@@ -640,7 +640,9 @@ export namespace Session {
|
|||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.text)
|
if (result.text)
|
||||||
return Session.update(input.sessionID, (draft) => {
|
return Session.update(input.sessionID, (draft) => {
|
||||||
draft.title = result.text
|
const cleaned = result.text.replace(/<think>[\s\S]*?<\/think>\s*/g, "")
|
||||||
|
const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
|
||||||
|
draft.title = title
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
|
|||||||
Reference in New Issue
Block a user