Skip to content

feat(desktop): boot-failure recovery + live API-key validation - #35864

Merged
OutThisLife merged 1 commit into
bb/guifrom
bb/desktop-boot-recovery
May 31, 2026
Merged

feat(desktop): boot-failure recovery + live API-key validation#35864
OutThisLife merged 1 commit into
bb/guifrom
bb/desktop-boot-recovery

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

Fresh-install failure paths in the desktop app were dead ends. Observed on a fresh macOS VM and again reopening hermes.exe: the gateway failed to come up, the shell rendered bricked ("gateway offline", dead composer, only a toast), logs were undiscoverable, and a mistyped OpenRouter key was accepted because onboarding only checked credential presence, not validity.

This adds self-healing + repair affordances and real key validation.

Boot-failure recovery

  • New BootFailureOverlay mounts on any hard boot failure (gateway never connected, backend exited during startup, latched bootstrap failure) — including post-install, which previously had zero recovery UI. Actions: Retry, Repair install, Use local gateway, Open logs, plus collapsible recent log lines.
  • hermes:bootstrap:repair IPC drops the bootstrap-complete marker so the next launch re-runs the installer (refreshes a broken/partial venv). Clearly labeled as slow.
  • Trimmed the now-redundant recovery button from the onboarding Preparing panel (the overlay supersedes it).

Logs

  • hermes:logs:reveal (reveals desktop.log in the file manager) + hermes:logs:recent. Surfaced in the recovery overlay and as a Diagnostics → Open logs row in Gateway settings.

Live API-key validation

  • POST /api/providers/validate: a cheap live probe per provider — OpenRouter (/api/v1/key), OpenAI/xAI (/v1/models), Gemini (/v1beta/models?key=), and connectivity-only for local/custom endpoints.
  • saveOnboardingApiKey now validates before persisting: a rejected key (reachable + 401/403) blocks with a real error; an unreachable probe (offline / provider down) falls through and saves, so offline users aren't stranded.

Notes

  • An unrelated formatter reflow in hermes_cli/gateway.py was intentionally left out of this branch.

Test plan

  • apps/desktop npm run type-check clean
  • eslint clean on changed files (pre-existing warnings untouched)
  • scripts/run_tests.sh tests/hermes_cli/test_web_server.py — 178 passed (incl. 6 new network-free validation-branch tests)
  • Manual: trigger a boot failure (kill backend / bad install) and confirm Retry / Repair / Open logs / Use local gateway
  • Manual: paste a wrong OpenRouter key → blocked with "rejected" error; correct key → proceeds

… on entry

Fresh installs that hit a gateway boot failure had no recovery path: the
shell rendered dead ("gateway offline"), logs were undiscoverable, and a
mistyped API key was accepted because onboarding only checked credential
presence, not validity.

- Add BootFailureOverlay: a top-level recovery surface (Retry, Repair
  install, Use local gateway, Open logs + inline recent logs) that mounts
  on any hard boot failure, including post-install. Trims the now-redundant
  recovery button from the onboarding Preparing panel.
- Add hermes:logs:reveal / :recent IPC (reveal desktop.log) and a
  hermes:bootstrap:repair IPC that drops the bootstrap marker to force a
  clean reinstall. Surface "Open logs" in Gateway settings too.
- Add POST /api/providers/validate: a live per-provider probe
  (OpenRouter/OpenAI/xAI/Gemini key check, local endpoint connectivity)
  wired into saveOnboardingApiKey so a rejected key blocks before it's
  persisted, while an unreachable probe falls through (offline-safe).
@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery javascript labels May 31, 2026
@OutThisLife
OutThisLife merged commit 6d6337b into bb/gui May 31, 2026
7 checks passed
@OutThisLife
OutThisLife deleted the bb/desktop-boot-recovery branch May 31, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants