feat(chat): send SSE keep-alive ping heartbeats during polling

This commit is contained in:
yiling
2026-07-13 12:17:00 +08:00
parent 02f2fde8ac
commit d560032013
2 changed files with 43 additions and 0 deletions
+6
View File
@@ -109,6 +109,12 @@ const route = new Hono<{ Variables: { user: User } }>()
})
}
lastEntryId = newEntries[newEntries.length - 1].id
} else {
await stream.writeSSE({
data: JSON.stringify({
type: 'ping',
}),
})
}
// Check if workflow has finished