Skip to content

fix(ui): prevent OpenAI API Host fallback when saving other fields#7246

Closed
bavadim wants to merge 3 commits intoblock:mainfrom
redsquad-tech:fix/preserve-api-host-on-provider-resave
Closed

fix(ui): prevent OpenAI API Host fallback when saving other fields#7246
bavadim wants to merge 3 commits intoblock:mainfrom
redsquad-tech:fix/preserve-api-host-on-provider-resave

Conversation

@bavadim
Copy link
Contributor

@bavadim bavadim commented Feb 16, 2026

Summary

Fixes a UI bug in OpenAI provider settings where saving changes to a non-host field can cause the effective API Host to fall back to default (https://api.openai.com) even when API Host was not edited.

The UI can still display the previously entered host text, so the regression is easy to miss.

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

  • Unit test (new):
    • ui/desktop/src/components/settings/providers/modal/subcomponents/handlers/DefaultSubmitHandler.test.ts
    • Covers OpenAI regression: update OPENAI_API_KEY without editing OPENAI_HOST, and assert host does not revert to default.
  • Verification result:
    • Test fails on main (host falls back to default).
    • Test passes with this fix branch.

Related Issues

Relates to #7245
Discussion: #7245

Screenshots/Demos (for UX changes)

Before:
Changing another OpenAI field and saving could make effective API Host revert to default while UI still showed old host text.

After:
Saving changes to non-host fields preserves previously configured API Host.

@bavadim bavadim changed the title fix(ui): preserve API host when saving provider config unchanged fix(ui): prevent OpenAI API Host fallback when saving other fields Feb 16, 2026
Signed-off-by: bavadim <bavadim@gmail.com>
Signed-off-by: bavadim <bavadim@gmail.com>
@bavadim bavadim force-pushed the fix/preserve-api-host-on-provider-resave branch from f5ab842 to 1e5367a Compare February 16, 2026 09:58
@DOsinga
Copy link
Collaborator

DOsinga commented Feb 17, 2026

thanks! somebody else also fixed this. since they have the DCO check, going to merge that one, but appreciate your efforts!

@DOsinga DOsinga closed this Feb 17, 2026
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

Comments