Skip to content

Commit 6428352

Browse files
author
Brendan DeBeasi
committed
fix: add null check for title agent in summary.ts
Fixes anomalyco#7262 - Session titles stopped auto-generating because the title agent might not exist. Added safety check similar to prompt.ts to prevent crashes when agent is undefined.
1 parent e4cff26 commit 6428352

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export namespace SessionSummary {
7777
const textPart = msgWithParts.parts.find((p) => p.type === "text" && !p.synthetic) as MessageV2.TextPart
7878
if (textPart && !userMsg.summary?.title) {
7979
const agent = await Agent.get("title")
80+
if (!agent) return
8081
const stream = await LLM.stream({
8182
agent,
8283
user: userMsg,

0 commit comments

Comments
 (0)