Skip to content

fix(desktop): preserve curated provider model lists#3613

Merged
esengine merged 1 commit into
esengine:main-v2from
closss:fix/preserve-provider-model-refresh
Jun 9, 2026
Merged

fix(desktop): preserve curated provider model lists#3613
esengine merged 1 commit into
esengine:main-v2from
closss:fix/preserve-provider-model-refresh

Conversation

@closss

@closss closss commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This fixes the desktop provider model refresh flow so fetched model lists no longer overwrite a user's curated model list.

Before this change:

  • Background model discovery on the Settings usage tab replaced saved provider models with the full API response.
  • Saving an API key and auto-refreshing could also replace the saved list.
  • Manual refresh replaced the list instead of preserving existing curated entries.

After this change:

  • Background and API-key auto-refresh preserve a non-empty saved model list, and only populate providers that do not have models yet.
  • Manual refresh appends newly discovered models while keeping existing entries intact.
  • The provider default model is preserved when still available, otherwise it falls back to the first saved model.

Issues

Fixes #3465
Fixes #3506
Fixes #3529

Implementation notes

  • Extracted provider model merge/default selection logic into desktop/frontend/src/lib/providerModels.ts.
  • Reused that helper in the three model-refresh paths in SettingsPanel.tsx.
  • Added focused tests for manual merge behavior, background curation preservation, empty-list population, and default fallback.
  • Kept the patch scoped to desktop settings model-refresh behavior.

Tests

  • npm run test:all
  • git diff --check
  • gofmt -l
  • go test ./...

@closss closss requested review from SivanCola and esengine as code owners June 8, 2026 19:25
@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 8, 2026
@esengine esengine closed this Jun 9, 2026
@esengine esengine reopened this Jun 9, 2026

@esengine esengine 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.

Full CI matrix is green after the re-trigger, and the model-list merge logic reviewed cleanly (preserve-curated vs union merge, with a focused test). Approving.

@esengine esengine merged commit b49b2d1 into esengine:main-v2 Jun 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

2 participants