feat(hermes): Hermes-only mode — run with no Open WebUI server#522
Draft
cogwheel0 wants to merge 3 commits into
Draft
feat(hermes): Hermes-only mode — run with no Open WebUI server#522cogwheel0 wants to merge 3 commits into
cogwheel0 wants to merge 3 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
d909c37 to
42aac43
Compare
Make Open WebUI optional so a user can install the app and use a self-hosted Hermes Agent exclusively. The mode is derived from what's configured and is switchable; first run shows a backend chooser. - Mode signals: a synchronous persisted `preferredBackend` (unset|owui|hermes) for boot-deterministic routing, plus a derived `hermesOnlyMode` for UI gating (mirrors the reviewer-mode precedent). - Router: Hermes-only short-circuits to chat with no OWUI server/auth; first run routes to a new backend chooser; holds splash while Hermes secrets load. - Onboarding: BackendChooserPage + HermesSettingsPage(isOnboarding) with a Finish button that sets preferredBackend=hermes and enters the app. - Models/defaultModel surface + auto-select the synthetic Hermes model when there's no OWUI API; send guard relaxed for Hermes models. - UI gating: hide chats/notes/terminal/channels (3 synced sites); Hermes is the home tab. preferredBackend=owui set on OWUI connect. Verified end-to-end on an erased iOS simulator (fresh install): chooser → Hermes setup → Finish → Hermes-only chat → only the Hermes tab → relaunch boots straight to chat → send creates a server session with no OWUI. flutter analyze clean; flutter test (2200) passing.
…, tests Address the Hermes-only follow-ups: - Composer: hide OWUI affordances (the "+" overflow button, quick pills, and the iOS keyboard-accessory actions) when a Hermes model is selected — Hermes has no OWUI tools/web-search/image-gen/attachments and uses its own `/` skills. - iOS native settings sheet: gate the OWUI account sections (profile header, AI memory, data connection, password + profile detail sheets, sign-out) on Hermes-only, and make the About detail skip the server lookup so it no longer errors with no server. - Bidirectional switching: add a "Connect to Open WebUI" entry in both the native sheet (routed via a control event in main.dart) and the Flutter profile page; let the router reach the OWUI connect/auth routes for a Hermes-only user; reset preferredBackend to unset when a Hermes-only backend is disabled. - Tests: preferredBackend parse/persistence round-trip and hermesOnlyMode derivation (usable/no-server, server-present, disabled, incomplete, reviewer precedence). flutter analyze clean; flutter test (2211) passing.
…tests
Close out the last Hermes-only follow-ups:
- iOS native settings sheet: render a Hermes-branded profile header in
Hermes-only mode ("Hermes Agent" + the agent host + the hermes_agent.png
avatar). Fully data-driven from Dart — no Swift change; the avatar bytes are
pre-loaded (cached) before the sync config builder runs.
- Extract the inline send/regenerate guard into a pure isSendBlocked() helper
used at both sites, removing the duplicated condition and making the
Hermes-only relaxation unit-testable.
- Tests: isSendBlocked (null model, OWUI-no-api, api present, reviewer, Hermes
relaxation); modelsProvider surfaces only the synthetic Hermes model when
unauthed + usable Hermes; defaultModelProvider auto-selects + writes through
the Hermes model when api == null.
flutter analyze clean; flutter test (2218) passing.
42aac43 to
9695628
Compare
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
Makes Open WebUI optional so a user can install the app and use a self-hosted Hermes Agent exclusively — no OWUI server at all. The mode is derived from what's configured and is switchable anytime; first run shows a backend chooser.
Stacked on
feat/hermes-agent(#521) — review that one first; this PR's diff is the Hermes-only delta.Design — two signals
preferredBackendProvider(lib/core/providers/backend_mode_providers.dart) — a synchronous, persistedNotifier<PreferredBackend>(unset | owui | hermes). Read by the router only, for boot determinism — mirrorsreviewerModeProvider's synchronous role. On cold boot the router runsredirect()whileactiveServerProvideris still loading and Hermes secrets are still loading, so a purely-derived gate would bounce a Hermes-only user to server-connection. The flag avoids that; real gating stays derived.hermesOnlyModeProvider(derived, inhermes_providers.dart) —!reviewerMode && hermesConfig.isUsable && activeServer == null. Drives UI gating; widgets rebuild as it settles.What's included
BackendChooserPage(Connect to Open WebUI / Use a Hermes Agent) +Routes.backendChooser. ReusesHermesSettingsPage(isOnboarding: true)with a "Finish setup" button that validatesisUsable, setspreferredBackend = hermes, and enters the app.chatbefore any OWUI server/auth branch; holdssplash(not server-connection) while Hermes secrets load; first run → chooser. Disabled-Hermes safety net avoids a stuck splash.Models.build/defaultModelProvidersurface + auto-select the synthetic Hermes model when there's no OWUI API. Send guard relaxed (extracted to a pureisSendBlocked()helper) to allowapi == nullfor Hermes models.preferredBackend = owuiis set on successful OWUI connect./skills).hermes_agent.pngavatar); the About detail skips the server lookup so it no longer errors with no server.main.dart) and the Flutter profile page; the router reaches the OWUI connect/auth routes for a Hermes-only user;preferredBackendresets tounsetwhen a Hermes-only backend is disabled.Verification
flutter analyzeclean;flutter test(2218) passing — incl. unit tests forpreferredBackendparse/persistence,hermesOnlyModederivation (usable/no-server, server-present, disabled, incomplete, reviewer precedence),isSendBlocked(the send-guard relaxation), andmodelsProvider/defaultModelProviderHermes surfacing + auto-select whenapi == null.