Fix archived agent reload failures

Unarchive provider storage before clearing Paseo's archived flag so failed native restores keep the snapshot archived. Keep initial history sync errors visible instead of falling back to the loading state.
This commit is contained in:
Mohamed Boudra
2026-06-20 21:33:25 +07:00
parent 27ecb3a7a9
commit 25252d1b86
9 changed files with 379 additions and 16 deletions
@@ -0,0 +1,19 @@
import type { AgentScreenMissingState } from "@/hooks/use-agent-screen-state-machine";
export function reconcileMissingAgentStateWithPresentAgent(
state: AgentScreenMissingState,
): AgentScreenMissingState {
if (state.kind === "resolving" || state.kind === "not_found") {
return { kind: "idle" };
}
return state;
}
export function clearHistorySyncErrorAfterSuccessfulSync(
state: AgentScreenMissingState,
): AgentScreenMissingState {
if (state.kind === "error") {
return { kind: "idle" };
}
return state;
}