mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 05:49:44 +08:00
fix(chat): distinguish prior completion from failed unsaved turn
This commit is contained in:
@@ -2715,7 +2715,7 @@ export function ChatStateAdapterProvider({
|
||||
live.sessions[key]?.isStreaming ||
|
||||
!["failed", "rejected"].includes(live.sessions[key]?.status ?? "")
|
||||
) return;
|
||||
if (remote.active_turns?.length || remote.status === "completed") {
|
||||
if (remote.active_turns?.length) {
|
||||
void loadSessionRef.current?.(session.sessionId);
|
||||
return;
|
||||
}
|
||||
@@ -2730,7 +2730,7 @@ export function ChatStateAdapterProvider({
|
||||
// A persisted user can go straight through the server's regenerate path.
|
||||
// If other rows arrived since this tab's snapshot, show them first.
|
||||
if (typeof lastUser.id === "number" && lastUser.id > 0) {
|
||||
if (newRows.length > 0) {
|
||||
if (newRows.length > 0 || remote.status === "completed") {
|
||||
void loadSessionRef.current?.(session.sessionId);
|
||||
} else {
|
||||
regenerateLastMessage();
|
||||
|
||||
Reference in New Issue
Block a user