fix: recover interrupted chat and candidate birth time adoption

This commit is contained in:
732642856
2026-07-21 12:55:10 +08:00
parent de37342a3e
commit 3d4fc40dae
2 changed files with 6 additions and 3 deletions
+3 -3
View File
@@ -2172,16 +2172,16 @@ export default function Home() {
await persistSession(interruptedSession);
setRequestError({
sessionId,
message: "回答中途断开,已保留生成内容;本次已开始生成并计费。",
message: "回答中途断开,已保留生成内容;请复制现有内容或继续追问,系统正在以账户记录为准同步点数。",
});
} catch (persistError) {
setRequestError({
sessionId,
message: `${persistError instanceof Error ? persistError.message : "云端同步失败"} 已计费的部分回答仍保留在当前页面,请复制保存。`,
message: `${persistError instanceof Error ? persistError.message : "云端同步失败"} 部分回答仍保留在当前页面,请复制保存后继续追问`,
});
}
if (activeSessionIdRef.current === sessionId) {
setComposerNotice("回答中途断开,已保留现有内容,本次已计费。");
setComposerNotice("回答中途断开,已保留现有内容;请继续追问或复制保存。");
}
}
} finally {
@@ -112,6 +112,9 @@ def test_chat_page_uses_authenticated_cloud_persistence() -> None:
assert 'await persistence' in source
assert "pendingSessionId || cancellationInFlight.current || pendingConsultation.current" in source
assert "setCancellationPending(true)" in source
assert "系统正在以账户记录为准同步点数" in source
assert "回答中途断开,已保留现有内容,本次已计费。" not in source
assert "本次已开始生成并计费" not in source
assert 'localStorage.setItem(chartLibraryStorageKey(accountId)' in source
assert 'localStorage.setItem("chat_sessions"' not in source