|
|
@@ -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)
|
|
|
}
|
|
|
}
|