mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-29 11:14:23 +00:00
fix: strip thinking blocks from title (#1325)
This commit is contained in:
parent
2630104f18
commit
ad8a4bc744
1 changed files with 3 additions and 1 deletions
|
|
@ -640,7 +640,9 @@ export namespace Session {
|
|||
.then((result) => {
|
||||
if (result.text)
|
||||
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(() => {})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue