snow-flow 10.0.206 → 10.0.207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/session/processor.ts
CHANGED
|
@@ -270,7 +270,7 @@ export namespace SessionProcessor {
|
|
|
270
270
|
SessionSummary.summarize({
|
|
271
271
|
sessionID: input.sessionID,
|
|
272
272
|
messageID: input.assistantMessage.parentID,
|
|
273
|
-
})
|
|
273
|
+
}).catch((err) => log.warn("summarize failed", { error: err }))
|
|
274
274
|
if (
|
|
275
275
|
!input.assistantMessage.summary &&
|
|
276
276
|
(await SessionCompaction.isOverflow({ tokens: usage.tokens, model: input.model }))
|
package/src/session/prompt.ts
CHANGED
|
@@ -581,7 +581,7 @@ export namespace SessionPrompt {
|
|
|
581
581
|
SessionSummary.summarize({
|
|
582
582
|
sessionID: sessionID,
|
|
583
583
|
messageID: lastUser.id,
|
|
584
|
-
})
|
|
584
|
+
}).catch((err) => log.warn("summarize failed", { error: err }))
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
// Ephemerally wrap queued user messages with a reminder to stay on track.
|
|
@@ -56,7 +56,13 @@ export namespace SessionSuggestion {
|
|
|
56
56
|
retries: 2,
|
|
57
57
|
})
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
let result: string
|
|
60
|
+
try {
|
|
61
|
+
result = (await stream.text).trim()
|
|
62
|
+
} catch (err) {
|
|
63
|
+
log.warn("suggestion generation failed", { error: err })
|
|
64
|
+
return
|
|
65
|
+
}
|
|
60
66
|
if (!result) return
|
|
61
67
|
|
|
62
68
|
log.info("suggestion", { sessionID: input.sessionID, suggestion: result })
|
package/src/session/summary.ts
CHANGED
|
@@ -159,7 +159,14 @@ export namespace SessionSummary {
|
|
|
159
159
|
system: [],
|
|
160
160
|
retries: 3,
|
|
161
161
|
})
|
|
162
|
-
|
|
162
|
+
let result: string
|
|
163
|
+
try {
|
|
164
|
+
result = await stream.text
|
|
165
|
+
} catch (err) {
|
|
166
|
+
log.warn("title generation failed", { error: err })
|
|
167
|
+
return
|
|
168
|
+
}
|
|
169
|
+
if (!result) return
|
|
163
170
|
log.info("title", { title: result })
|
|
164
171
|
userMsg.summary.title = result
|
|
165
172
|
await Session.updateMessage(userMsg)
|