fix(desktop): keep onboarding cache sticky across transient runtime failures (fixes #37554) - #37634
Closed
Morad37 wants to merge 1 commit into
Closed
fix(desktop): keep onboarding cache sticky across transient runtime failures (fixes #37554)#37634Morad37 wants to merge 1 commit into
Morad37 wants to merge 1 commit into
Conversation
…ailures (fixes NousResearch#37554) refreshOnboarding() used to unconditionally write cached configured=false and flip the store state to false on any runtime probe failure, overwriting the optimistic localStorage cache from a previous successful onboarding. Returning users whose runtime check transiently failed (gateway still warming up, momentary timeout, runtime/credentials mismatch) would see the onboarding overlay flash on every reload and have to re-add their provider. Keep the cache sticky once configured=true, surface the runtime failure as a notification so the user still knows something is off, and only flip configured=false on a true first run with no prior cache.
Collaborator
|
Merged via PR #51884 — your idea of surfacing a notification on the preserve path (rather than silently returning) was incorporated into the salvage. Your PR #37634 correctly identified the bug and proposed the right product behavior (non-blocking notification + keep configured). The salvage used @infinitycrew39's more surgical Both approaches are credited in the PR #51884 body. Thanks for the report and the fix! |
kshitijk4poor
added a commit
that referenced
this pull request
Jun 24, 2026
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 #37634.
pai-scaffolde
pushed a commit
to pai-scaffolde/hermes-agent
that referenced
this pull request
Jun 28, 2026
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.
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
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.
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
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.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
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.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
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.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
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.
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.
What does this PR do?
Stops
refreshOnboarding()from downgrading the optimistic onboarding cache fromtruetofalseon transient runtime probe failures. A returning user whose runtime check transiently fails (gateway still warming up, momentary timeout, runtime/credentials mismatch) used to see the onboarding overlay flash on every reload and have to re-add their provider, even though the durable bootstrap marker on disk said onboarding was complete.Why
localStorage['hermes-desktop-onboarded-v1']is only an optimistic cache. Every gateway open triggersrefreshOnboarding(), which callsevaluateRuntimeReadiness()and on failure ran:That overwrite defeated the cache: the next reload would re-evaluate and re-flip. The bootstrap marker (
.hermes-bootstrap-complete) is the durable source of truth, but the renderer can't see it directly, so the right fix is to keep the cache sticky once it has been set and surface the runtime failure as a notification rather than a full re-onboarding.Changes
apps/desktop/src/store/onboarding.ts— inrefreshOnboarding(), when the runtime probe returnsready: false, only downgradeconfiguredtofalseif neither the in-memory state nor the localStorage cache already saysconfigured === true. If we were already configured, keep the cache and callnotifyError(...)so the user still sees a heads-up that the gateway isn't reachable.apps/desktop/src/store/onboarding.test.ts— adds two regression tests:configured === true+ transient runtime failure: store staysconfigured: true, cache is preserved, no API refresh fires.configured: falseand refreshes providers.How to test
cd apps/desktop && npx vitest run --environment jsdom src/store/onboarding.test.ts— all 5 tests pass.npx eslint src/store/onboarding.ts src/store/onboarding.test.ts— 0 errors (5 pre-existing padding-line warnings on lines unrelated to this change).npx tsc --noEmit -p tsconfig.json— 0 errors in changed files. (One pre-existing TS2307 insrc/app/messaging/platform-icon.tsxis unrelated.)Notes
runtime.ready === falseAND the user has previously completed onboarding. First-run onboarding still works exactly as before.Closes #37554