mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
only gen summary if diffs
This commit is contained in:
parent
f9674793af
commit
651a10d6db
1 changed files with 4 additions and 7 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue