Repository navigation
fix(desktop): preserve onboarding state on transient runtime probe failures - #51884
Merged
Merged
Conversation
When shouldPreserveConfiguredOnFallback keeps configured=true, also call
notifyError('runtime-not-ready', ...) so the user knows the backend wasn't
verified instead of silently proceeding. Adapted from @mohamedorigami-jpg's
approach in PR NousResearch#37634.
hermes-pr-review findings:
- notifyError('runtime-not-ready', msg) misused the (error, fallback) API:
the key became the notification body and the message became the title.
Switch to notify({ id, kind, title, message }) which puts content in the
right slots.
- The stable id 'runtime-not-ready' deduplicates: notify() replaces by id,
so repeated refreshOnboarding calls during an outage no longer stack
up to 4 persistent error toasts.
- Remove dead !state.manual guard from shouldPreserveConfiguredOnFallback:
refreshOnboarding already short-circuits on manual before the helper.
- Test: seed localStorage with '1' before asserting it survives (was testing
the wrong invariant — null in, null out).
- Test: use static import for spy instead of fragile await import.
- Test: add negative case for requested=true + configured=true (should
still downgrade — requested overrides preservation).
This was referenced Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Desktop onboarding no longer downgrades
configured: truetofalsewhen gateway runtime probes timeout transiently — returning users stay in the chat UI instead of seeing the onboarding overlay flash on every restart.Root cause:
refreshOnboarding()treated ALL non-ready results as authoritative, includingsource: 'fallback'(both probes timed out / transport failure). A transient gateway timeout during startup would clear the optimistic cache and force the blocking onboarding overlay even though the user had already completed setup.Changes
apps/desktop/src/store/onboarding.ts— newshouldPreserveConfiguredOnFallback()helper checksruntime.source === 'fallback' && state.configured === true && !state.requested. When true,refreshOnboarding()returns early without downgrading, and fires a non-blockingnotify()with stable id'runtime-not-ready'(deduplicates across repeated calls during an outage).apps/desktop/src/store/onboarding.test.ts— 6 new tests covering: fallback preserves configured, notification fires,requested=trueoverrides preservation, first-run still downgrades, plus the pre-existing tests remain green.Validation
Credits
shouldPreserveConfiguredOnFallbackhelper and initial testsnotifyErroron the preserve path)Closes #37554