feat(chat): filter out context messages from API list and SSE stream

This commit is contained in:
yiling
2026-07-11 15:47:48 +08:00
parent 35db3fc49e
commit cc9b32716d
3 changed files with 82 additions and 2 deletions
+2
View File
@@ -67,6 +67,7 @@ const route = new Hono<{ Variables: { user: User } }>()
if (newEntries.length > 0) {
for (const record of newEntries) {
const message = mapEntryToMessage(record)
if (!message) continue
await stream.writeSSE({
data: JSON.stringify({
type: 'entry',
@@ -94,6 +95,7 @@ const route = new Hono<{ Variables: { user: User } }>()
})
for (const record of finalEntries) {
const message = mapEntryToMessage(record)
if (!message) continue
await stream.writeSSE({
data: JSON.stringify({
type: 'entry',