only gen summary if diffs

This commit is contained in:
Dax Raad 2025-12-12 16:24:26 -05:00
parent f9674793af
commit 651a10d6db

View file

@ -130,10 +130,7 @@ export namespace SessionSummary {
m.info.role === "assistant" && m.parts.some((p) => p.type === "step-finish" && p.reason !== "tool-calls"),
)
) {
let summary = messages
.findLast((m) => m.info.role === "assistant")
?.parts.findLast((p) => p.type === "text")?.text
if (!summary || diffs.length > 0) {
if (diffs.length > 0) {
for (const msg of messages) {
for (const part of msg.parts) {
if (part.type === "tool" && part.state.status === "completed") {
@ -167,10 +164,10 @@ export namespace SessionSummary {
},
},
}).catch(() => {})
if (result) summary = result.text
if (result) {
userMsg.summary.body = result.text
}
}
userMsg.summary.body = summary
log.info("body", { body: summary })
await Session.updateMessage(userMsg)
}
}