summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-07-26 08:29:04 -0500
committerGitHub <[email protected]>2025-07-26 08:29:04 -0500
commitad8a4bc74475b87016fb59a3359d914d8d1f8b86 (patch)
treefe37d0422697477e477b344015d2f4aea00e9dc3
parent2630104f18d179c8d0a8a485c4e45819f60ffefe (diff)
downloadopencode-ad8a4bc74475b87016fb59a3359d914d8d1f8b86.tar.gz
opencode-ad8a4bc74475b87016fb59a3359d914d8d1f8b86.zip
fix: strip thinking blocks from title (#1325)
-rw-r--r--packages/opencode/src/session/index.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts
index 86e3e15b7..0884c658b 100644
--- a/packages/opencode/src/session/index.ts
+++ b/packages/opencode/src/session/index.ts
@@ -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(() => {})