mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-14 15:16:35 +03:00
Merge pull request #414 from pbakaus/live-error-clears-checkpoint
Live mode: clear the durable session checkpoint on a terminal SSE error reply
This commit is contained in:
@@ -6499,6 +6499,19 @@
|
||||
if (maybeCompleteSteer(msg)) break;
|
||||
console.error('[impeccable] Error:', msg.message);
|
||||
showToast('Error: ' + msg.message, 5000);
|
||||
// An agent error reply is terminal for the session it names: tear
|
||||
// it down exactly like 'discarded' (cleanup includes clearSession),
|
||||
// or the durable localStorage checkpoint survives and every reload
|
||||
// resurrects a GENERATING bar for a session the server no longer
|
||||
// knows about (issue #362).
|
||||
if (msg.id && msg.id === currentSessionId) {
|
||||
markSessionHandled();
|
||||
cleanup();
|
||||
break;
|
||||
}
|
||||
// A stored-but-not-current checkpoint naming the errored session
|
||||
// (the error raced a reload) must not resurrect either.
|
||||
if (msg.id && loadSession()?.id === msg.id) clearSession();
|
||||
hideBar();
|
||||
renderEditBadge('hidden');
|
||||
setLiveState('PICKING');
|
||||
|
||||
Reference in New Issue
Block a user