修复新会话可能出现响应不显示的情况

This commit is contained in:
xintaofei
2026-03-11 13:06:05 +08:00
parent 7dabb74de3
commit f74fe371da
3 changed files with 16 additions and 3 deletions

View File

@@ -250,7 +250,10 @@ function reduceHydrateDetail(
...(current ?? createEmptySession(conversationId)),
externalId: nextExternalId,
persistedTurns,
liveMessage: hasPersistedAdvance ? null : (current?.liveMessage ?? null),
liveMessage:
hasPersistedAdvance && current?.syncState !== "awaiting_persist"
? null
: (current?.liveMessage ?? null),
optimisticTurns: shouldDropOptimistic ? [] : optimisticTurns,
syncState: shouldDropOptimistic ? "idle" : (current?.syncState ?? "idle"),
activeTurnToken: shouldDropOptimistic