Skip to content

fix(android): list and apply chat models without a Desktop Gateway - #97

Open
software-greg wants to merge 1 commit into
rusty4444:mainfrom
software-greg:fix/model-picker-without-gateway
Open

software-greg wants to merge 1 commit into
rusty4444:mainfrom
software-greg:fix/model-picker-without-gateway

Conversation

@software-greg

Copy link
Copy Markdown

The per-chat model picker is coupled to the Desktop Gateway WebSocket: _showModelSelector returns early unless a gateway client exists, and applying a choice pushes it over that socket via setSessionModel / setSessionReasoning. Any deployment without a reachable gateway therefore has a permanently dead picker, even though chat, sessions and history all work.

Listing needs only api/model/info and api/model/options over dashboard REST, and the API server already resolves a per-request model field, so the socket is not reqd for either half of the feature.

  • list models through DashboardClient when no gateway is configured;
  • keep the selection local and persisted instead of pushing it over the socket;
  • carry the chosen model as the model field on the chat request, which sendMessageStreaming already accepts.

Reasoning effort remains gateway-only and is simply not applied in this mode.

Gateway turn recovery and its journal invariants are untouched: with a gateway configured every path behaves as before.

Motivation: we run Hermes headless and reverse-proxy only a handful of read-only dashboard GETs to the android client -- api/model/{info,options} for this picker, plus api/{memory,skills,cron/jobs} for the read-only tabs -- while deliberately not routing api/config, which returns provider keys and passwords. Every one of those tabs already works over REST; the model picker was the only feature that reached for the gateway socket, and only to read two endpoints we already publish.

The per-chat model picker is coupled to the Desktop Gateway WebSocket:
`_showModelSelector` returns early unless a gateway client exists, and applying
a choice pushes it over that socket via `setSessionModel` / `setSessionReasoning`.
Any deployment without a reachable gateway therefore has a permanently dead
picker, even though chat, sessions and history all work.

Listing needs only `api/model/info` and `api/model/options` over dashboard REST,
and the API server already resolves a per-request `model` field, so the socket is
not actually required for either half of the feature.

- list models through `DashboardClient` when no gateway is configured;
- keep the selection local and persisted instead of pushing it over the socket;
- carry the chosen model as the `model` field on the chat request, which
  `sendMessageStreaming` already accepts.

Reasoning effort remains gateway-only and is simply not applied in this mode.

Gateway turn recovery and its journal invariants are untouched: with a gateway
configured every path behaves exactly as before.
@software-greg

Copy link
Copy Markdown
Author

Related issues:

@rusty4444 rusty4444 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hermes automation review — APPROVED (not auto-merging this pass)

  • Well-scoped, conservative fix: _modelListingClient() only builds a DashboardClient when no Desktop Gateway is configured; the restClient! null-safety is sound by construction.
  • Verified against the repo: constructor args match DashboardClient, referenced SavedConnection getters exist, and gateway-connected sessions still route through the existing gateway message paths — no regression to the desktop-gateway flow.
  • ⚠️ This branch has no CI checks reported — merge only once CI is visible and green.
  • ⚠️ Merge-order: #95/#96 also modify chat_screen.dart; expect a rebase after those land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants