Skip to content

fix(desktop): preserve local model provider endpoint - #65254

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
AtakanGs:fix-desktop-ollama-base-url
Jul 28, 2026
Merged

fix(desktop): preserve local model provider endpoint#65254
teknium1 merged 1 commit into
NousResearch:mainfrom
AtakanGs:fix-desktop-ollama-base-url

Conversation

@AtakanGs

Copy link
Copy Markdown
Contributor

Fixes #65201

Summary

Preserves the configured endpoint when selecting a local or user-defined model provider in the Desktop model settings.

Previously, Desktop displayed the selected Ollama provider and model correctly, but the model assignment request omitted the provider endpoint. The backend then cleared the previous base_url, leaving the local provider without an endpoint and allowing runtime resolution to fall back to OpenRouter-compatible handling.

Root cause

/api/model/options exposes the endpoint for user-defined providers as api_url.

The Desktop ModelOptionProvider type did not include that field, and applyMainModel() only submitted:

  • model
  • provider
  • scope

As a result, switching to Ollama/custom persisted the provider selection without persisting its endpoint.

Fix

  • Add api_url to ModelOptionProvider.
  • Pass the selected provider's api_url back as base_url when applying the main model.
  • Preserve existing behavior for providers that do not expose a custom endpoint.
  • Add a regression test covering a user-defined Ollama provider.

Testing

  • Added regression test:
    preserves a user-defined provider endpoint when applying the main model
  • Focused Desktop test suite: 11 passed
  • ESLint on changed files: 0 errors
    • One existing react-hooks/exhaustive-deps warning remains outside this change.
  • git diff --check: passed
  • Rebased onto the latest origin/main and reran the focused tests successfully.

Typecheck note

The full Desktop typecheck is currently blocked by 7 unrelated errors in existing assistant-ui integration files involving installed package API mismatches. None of the reported errors are in the files changed by this PR.

@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) area/config Config system, migrations, profiles P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 15, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused regression fix. Current main still posts the settings selection without base_url at apps/desktop/src/app/settings/model-settings.tsx:589, while the backend clears a prior endpoint on a provider change without an explicit replacement at hermes_cli/web_server.py:1161-1167. The picker contract exposes configured-provider endpoints as api_url at hermes_cli/model_switch.py:2381-2390; forwarding that value as this PR does is consistent with the assignment API.

The added Ollama regression assertion covers the reported settings-path failure.

Automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 16, 2026
@teknium1
teknium1 force-pushed the fix-desktop-ollama-base-url branch from 083a55f to fe4c92f Compare July 28, 2026 21:00
@teknium1
teknium1 merged commit fa92175 into NousResearch:main Jul 28, 2026
34 checks passed
teknium1 added a commit that referenced this pull request Jul 29, 2026
Sibling of #65254 (main-slot endpoint preservation): the auxiliary scope of
POST /api/model/set dropped the request's base_url/api_key on the floor, so
an aux slot pinned to a custom/local endpoint silently depended on
model.base_url — and broke the moment the main slot switched away and
cleared it. The aux resolver already reads auxiliary.<task>.base_url/api_key
(_resolve_task_provider_model); this persists them.

Desktop side: setAuxiliaryToMain / applyAuxiliaryDraft now carry the
user-defined provider's api_url as base_url, mirroring applyMainModel.
teknium1 added a commit that referenced this pull request Jul 29, 2026
Sibling of #65254 (main-slot endpoint preservation): the auxiliary scope of
POST /api/model/set dropped the request's base_url/api_key on the floor, so
an aux slot pinned to a custom/local endpoint silently depended on
model.base_url — and broke the moment the main slot switched away and
cleared it. The aux resolver already reads auxiliary.<task>.base_url/api_key
(_resolve_task_provider_model); this persists them.

Desktop side: setAuxiliaryToMain / applyAuxiliaryDraft now carry the
user-defined provider's api_url as base_url, mirroring applyMainModel.
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
Sibling of NousResearch#65254 (main-slot endpoint preservation): the auxiliary scope of
POST /api/model/set dropped the request's base_url/api_key on the floor, so
an aux slot pinned to a custom/local endpoint silently depended on
model.base_url — and broke the moment the main slot switched away and
cleared it. The aux resolver already reads auxiliary.<task>.base_url/api_key
(_resolve_task_provider_model); this persists them.

Desktop side: setAuxiliaryToMain / applyAuxiliaryDraft now carry the
user-defined provider's api_url as base_url, mirroring applyMainModel.
33hodl pushed a commit to 33hodl/hermes-agent that referenced this pull request Aug 12, 2026
Sibling of NousResearch#65254 (main-slot endpoint preservation): the auxiliary scope of
POST /api/model/set dropped the request's base_url/api_key on the floor, so
an aux slot pinned to a custom/local endpoint silently depended on
model.base_url — and broke the moment the main slot switched away and
cleared it. The aux resolver already reads auxiliary.<task>.base_url/api_key
(_resolve_task_provider_model); this persists them.

Desktop side: setAuxiliaryToMain / applyAuxiliaryDraft now carry the
user-defined provider's api_url as base_url, mirroring applyMainModel.
prmartinow pushed a commit to prmartinow/hermes-agent that referenced this pull request Aug 26, 2026
Sibling of NousResearch#65254 (main-slot endpoint preservation): the auxiliary scope of
POST /api/model/set dropped the request's base_url/api_key on the floor, so
an aux slot pinned to a custom/local endpoint silently depended on
model.base_url — and broke the moment the main slot switched away and
cleared it. The aux resolver already reads auxiliary.<task>.base_url/api_key
(_resolve_task_provider_model); this persists them.

Desktop side: setAuxiliaryToMain / applyAuxiliaryDraft now carry the
user-defined provider's api_url as base_url, mirroring applyMainModel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop GUI: Model selector shows local Ollama model but reverts to OpenRouter on message send

3 participants