mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-27 11:22:03 +00:00
fix(desktop): show non-blocking notification on fallback runtime probe
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.
This commit is contained in:
parent
7243111c57
commit
d398076c21
2 changed files with 33 additions and 0 deletions
|
|
@ -154,6 +154,31 @@ describe('refreshOnboarding', () => {
|
|||
expect(window.localStorage.getItem('hermes-desktop-onboarded-v1')).toBeNull()
|
||||
})
|
||||
|
||||
it('shows a non-blocking notification when preserving configured on fallback', async () => {
|
||||
const notifyErrorSpy = vi.spyOn(
|
||||
await import('@/store/notifications'),
|
||||
'notifyError'
|
||||
)
|
||||
|
||||
installApiMock(vi.fn())
|
||||
$desktopOnboarding.set(
|
||||
baseState({
|
||||
configured: true,
|
||||
providers: [provider('cached')],
|
||||
reason: null,
|
||||
requested: false
|
||||
})
|
||||
)
|
||||
|
||||
await refreshOnboarding(onboardingContext(fallbackTimeoutGateway()))
|
||||
|
||||
expect(notifyErrorSpy).toHaveBeenCalledWith(
|
||||
'runtime-not-ready',
|
||||
expect.stringContaining('could not verify the running backend')
|
||||
)
|
||||
expect($desktopOnboarding.get().configured).toBe(true)
|
||||
})
|
||||
|
||||
it('still surfaces onboarding when fallback failure happens before configured state', async () => {
|
||||
const api = vi.fn(async ({ path }: { path: string }) => {
|
||||
if (path === '/api/providers/oauth') {
|
||||
|
|
|
|||
|
|
@ -526,6 +526,14 @@ export async function refreshOnboarding(ctx: OnboardingContext) {
|
|||
|
||||
const state = $desktopOnboarding.get()
|
||||
if (shouldPreserveConfiguredOnFallback(runtime, state)) {
|
||||
// Gateway probes timed out but the user was already configured — don't
|
||||
// downgrade to the blocking onboarding overlay. Surface a non-blocking
|
||||
// notification so the user knows the backend wasn't verified.
|
||||
notifyError(
|
||||
'runtime-not-ready',
|
||||
'Hermes Desktop could not verify the running backend on startup. Some features may be unavailable until the gateway is reachable.'
|
||||
)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue