Skip to content

fix(gui): persist model config on save without clearing inputs and add guidance tooltips - #51

Merged
YoungSx merged 2 commits into
mainfrom
fix/persist-provider-config-on-save
Oct 17, 2026
Merged

YoungSx merged 2 commits into
mainfrom
fix/persist-provider-config-on-save

Conversation

@YoungSx

@YoungSx YoungSx commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the issue where configuring model settings (apiKey, modelBaseUrl, modelId) in the GUI would wipe/clear inputs on save, and adds interactive guidance tooltips with multi-provider examples.

Root Causes of Input Clearing

  1. Endpoint save gated behind credential check: applyModelSet in src/config-service.ts previously rejected saving modelBaseUrl or modelId if no credential was stored in auth.json.
  2. UI refreshed on failed saves: When saving failed, Incoming::ConfigResult in ui/src/main.rs still triggered a reload from disk, overwriting the user's input with the old empty values.
  3. Empty provider profile resets: Changing modelProvider switched to an empty provider dictionary in models.json, wiping all model fields in the dump.

Key Changes

  • Allow Endpoint Persistence Without Existing Keys: Removed the credential requirement in applyModelSet (src/config-service.ts) so developers can freely save Base URL, Model ID, and API keys independently.
  • Fix UI Refresh on Error: In ui/src/main.rs, only trigger config_get reload when result.ok != 0, preventing field overwrites on save failure.
  • Provider Default Seeding: Added KNOWN_PROVIDER_DEFAULTS for OpenAI, DeepSeek, OpenRouter, Anthropic, Ollama, and Bifrost so switching providers populates standard defaults instead of blanking out.
  • Interactive Help Tooltips (?): Added a circular hoverable ? icon next to each setting title in ui/settings.slint that pops open a detailed card with examples for mainstream providers.
  • Persistent Helper Hints & Placeholders: Added realistic input placeholder hints and compact inline example lines under Base URL, Model ID, API Key, and Model Provider.

Verification

  • bun test: All 812 tests passing.
  • cargo test: All 102 UI unit tests passing.
  • cargo check: UI builds cleanly.

- Prevent GUI settings inputs from being cleared on save by allowing endpoint fields (baseUrl, modelId) to persist without requiring an existing API key.
- Fix UI refresh on save error in ui/src/main.rs so failed responses do not overwrite active form values with disk state.
- Seed known provider defaults (OpenAI, DeepSeek, OpenRouter, Anthropic, Ollama, Bifrost) when switching modelProvider.
- Add interactive help tooltip icon (?) with rich multi-provider examples on hover, persistent helper hints, and realistic placeholder text in settings.slint.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-16T19:18:12.920869Z cacb974 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@YoungSx
YoungSx merged commit 62a3bc8 into main Oct 17, 2026
3 checks passed
@YoungSx
YoungSx deleted the fix/persist-provider-config-on-save branch October 17, 2026 06:20
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.

1 participant