fix(settings): persist custom provider baseUrl on creation (#414)#417
Merged
wyuc merged 1 commit intoTHU-MAIC:mainfrom Apr 14, 2026
Merged
fix(settings): persist custom provider baseUrl on creation (#414)#417wyuc merged 1 commit intoTHU-MAIC:mainfrom
wyuc merged 1 commit intoTHU-MAIC:mainfrom
Conversation
4fb85b8 to
f3d5581
Compare
f3d5581 to
3856364
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix custom OpenAI-compatible provider
baseUrlnot being persisted on creation, causing verify-model and generation requests to fail.Closes #414
Root Cause
handleAddProviderincomponents/settings/index.tsxhardcodedbaseUrl: ''while storing the user-entered URL indefaultBaseUrl. All downstream consumers (model-selector, provider-config-panel, model-edit-dialog, use-chat-sessions) only readbaseUrl, so the server received an empty string and fell back to SDK defaults (e.g.api.openai.com).Changes
Core fix
components/settings/utils.ts: NewcreateCustomProviderSettings()that stores the user-entered URL in bothbaseUrl(for requests) anddefaultBaseUrl(for placeholder/preview)components/settings/index.tsx:handleAddProvidernow usescreateCustomProviderSettings()Migration
lib/store/settings.ts:promoteLegacyCustomProviderBaseUrls()runs on rehydrate — promotesdefaultBaseUrl→baseUrlfor existing custom providers (!isBuiltIn && !baseUrl && defaultBaseUrl). Does not affect built-in providers.Refactor
components/settings/utils.ts: NewcreateVerifyModelRequest()to unify verify-model request body construction across 3 call sites (model-selector, provider-config-panel, model-edit-dialog)Tests
tests/settings/custom-provider-baseurl.test.ts: Tests thatcreateCustomProviderSettingsstoresbaseUrlcorrectly andcreateVerifyModelRequestbuilds the correct request bodytests/store/settings-server-sync.test.ts: Tests that migration promotesdefaultBaseUrlfor custom providers and leaves built-in providers untouchedVerification
npm test: 98 passed (0 failed)npx eslinton changed files: all cleanAssisted by Claude Opus 4.6 and GPT 5.4