Skip to content

The open source coding agent.

TypeScript

fix(session): ensure agent exists before processing title in session summary (#8662)

Qunhong Zengb14622352e54
diff --git a/packages/opencode/src/session/summary.ts b/packages/opencode/src/session/summary.ts
index 2bd1b0da601..dbca218f9c6 100644
--- a/packages/opencode/src/session/summary.ts
+++ b/packages/opencode/src/session/summary.ts
@@ -77,6 +77,7 @@ export namespace SessionSummary {
const textPart = msgWithParts.parts.find((p) => p.type === "text" && !p.synthetic) as MessageV2.TextPart
if (textPart && !userMsg.summary?.title) {
const agent = await Agent.get("title")
+ if (!agent) return
const stream = await LLM.stream({
agent,
user: userMsg,