fix: preserve text part timing in session processor (#21691)

This commit is contained in:
Kit Langton
2026-04-09 10:05:14 -04:00
committed by GitHub
parent c29392d085
commit 58a99916bb
2 changed files with 92 additions and 2 deletions

View File

@@ -352,7 +352,10 @@ export namespace SessionProcessor {
},
{ text: ctx.currentText.text },
)).text
ctx.currentText.time = { start: Date.now(), end: Date.now() }
{
const end = Date.now()
ctx.currentText.time = { start: ctx.currentText.time?.start ?? end, end }
}
if (value.providerMetadata) ctx.currentText.metadata = value.providerMetadata
yield* session.updatePart(ctx.currentText)
ctx.currentText = undefined