diff --git a/desktop/src/app/AppShell.tsx b/desktop/src/app/AppShell.tsx index e35c41c0d2..062f815ff3 100644 --- a/desktop/src/app/AppShell.tsx +++ b/desktop/src/app/AppShell.tsx @@ -160,10 +160,16 @@ export function AppShell() { // guard here would drop managed-agent coverage during startup. useAgentObserverIngestion(); useArchiveSync(); - useObserverArchiveSeed(identityQuery.data?.pubkey); - useAgentMetricArchiveSeed(identityQuery.data?.pubkey); - const profileQuery = useProfileQuery(); + // Defer the archive *seeds* until startup is idle: they're first-run catch-up + // config (a one-shot mergeSaveSubscriptionKinds), not live-ingest — that's + // useArchiveSync's job, which stays eager above. Passing deferredPubkey makes + // each seed hook wait on its own `if (!pubkey) return` guard until the shell + // is interactive, so their IPC + sqlite archive open doesn't compete with + // first paint. The explicit-choice guard inside each hook is unchanged. const deferredPubkey = startupReady ? identityQuery.data?.pubkey : undefined; + useObserverArchiveSeed(deferredPubkey); + useAgentMetricArchiveSeed(deferredPubkey); + const profileQuery = useProfileQuery(); useRelayAutoHeal(); usePresenceSubscription(); useUserStatusSubscription();