-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
🐛 fix(api): Fix the issue where custom AI Providers cannot use custom APIs #11335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 fix(api): Fix the issue where custom AI Providers cannot use custom APIs #11335
Conversation
|
@hardy-one is attempting to deploy a commit to the LobeHub OSS Team on Vercel. A member of the Team first needs to authorize it. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates client-side chat and model service API calls to use the original provider identifier in endpoint paths instead of the runtime SDK type, so that server-side lookups fetch the correct custom provider configuration. Sequence diagram for server chat request using provider instead of sdkTypesequenceDiagram
actor User
participant ChatUI
participant ChatService
participant API_ENDPOINTS
participant Server
participant ProviderConfigStore
participant ModelRuntime
User->>ChatUI: submitMessage(provider, sdkType, message)
ChatUI->>ChatService: sendChat(provider, sdkType, payload)
ChatService->>API_ENDPOINTS: chat(provider)
API_ENDPOINTS-->>ChatService: /api/chat/{provider}
ChatService->>Server: POST /api/chat/{provider} payload
Server->>ProviderConfigStore: getConfig(provider)
ProviderConfigStore-->>Server: ProviderConfig(sdkType, credentials,...)
Server->>ModelRuntime: initializeWithProvider(ProviderConfig)
ModelRuntime-->>Server: runtimeInstance
Server->>ModelRuntime: sendMessage(payload)
ModelRuntime-->>Server: streamingResponse
Server-->>ChatService: SSE stream
ChatService-->>ChatUI: deliverStream
ChatUI-->>User: renderAssistantMessages
Sequence diagram for model list and pull using provider identifiersequenceDiagram
actor User
participant ModelsUI
participant ModelsService
participant API_ENDPOINTS
participant Server
participant ProviderConfigStore
participant ModelRuntime
User->>ModelsUI: viewModels(provider, sdkType)
ModelsUI->>ModelsService: listModels(provider, runtimeProvider, headers)
alt useAgentRuntime
ModelsService->>ModelRuntime: models()
ModelRuntime-->>ModelsService: modelsList
else useServerAPI
ModelsService->>API_ENDPOINTS: models(provider)
API_ENDPOINTS-->>ModelsService: /api/models/{provider}
ModelsService->>Server: GET /api/models/{provider}
Server->>ProviderConfigStore: getConfig(provider)
ProviderConfigStore-->>Server: ProviderConfig(sdkType,...)
Server->>ModelRuntime: initializeWithProvider(ProviderConfig)
ModelRuntime-->>Server: modelsList
Server-->>ModelsService: modelsList
end
ModelsService-->>ModelsUI: modelsList
ModelsUI-->>User: showModels
User->>ModelsUI: pullModel(provider, model)
ModelsUI->>ModelsService: pullModel(provider, runtimeProvider, model, headers)
alt useAgentRuntime
ModelsService->>ModelRuntime: pullModel(model)
ModelRuntime-->>ModelsService: pullResult
else useServerAPI
ModelsService->>API_ENDPOINTS: modelPull(provider)
API_ENDPOINTS-->>ModelsService: /api/models/{provider}/pull
ModelsService->>Server: POST /api/models/{provider}/pull { model }
Server->>ProviderConfigStore: getConfig(provider)
ProviderConfigStore-->>Server: ProviderConfig(sdkType,...)
Server->>ModelRuntime: initializeWithProvider(ProviderConfig)
ModelRuntime-->>Server: runtimeInstance
Server->>ModelRuntime: pullModel(model)
ModelRuntime-->>Server: pullResult
Server-->>ModelsService: pullResult
end
ModelsService-->>ModelsUI: pullResult
ModelsUI-->>User: showPullStatus
Updated class diagram for chat and model services provider handlingclassDiagram
class ChatService {
+sendChat(provider, sdkType, payload, headers)
+buildAnimations(responseAnimation)
}
class ModelsService {
+listModels(provider, runtimeProvider, headers)
+pullModel(provider, runtimeProvider, model, headers, signal)
}
class API_ENDPOINTS {
+chat(provider)
+models(provider)
+modelPull(provider)
}
class ProviderConfigStore {
+getConfig(provider)
}
class ProviderConfig {
+provider
+sdkType
+credentials
+settings
}
class ModelRuntime {
+initializeWithProvider(providerConfig)
+models()
+pullModel(model)
+sendMessage(payload)
}
ChatService --> API_ENDPOINTS : uses
ChatService --> ModelRuntime : consumes via server
ModelsService --> API_ENDPOINTS : uses
ModelsService --> ModelRuntime : uses
ProviderConfigStore --> ProviderConfig : returns
ModelRuntime ..> ProviderConfig : depends on
API_ENDPOINTS ..> ProviderConfig : keyed by provider
ChatService ..> ProviderConfigStore : via server lookup
ModelsService ..> ProviderConfigStore : via server lookup
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
TestGru AssignmentSummary
Tip You can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- Given the subtle distinction between
provider,runtimeProvider, andsdkType, consider tightening the types or renaming parameters inAPI_ENDPOINTSand call sites so it’s harder to accidentally pass the wrong identifier in the future. - It may be helpful to add a small helper (e.g.
getProviderEndpointId(provider)or similar) to centralize the mapping logic and avoid repeating the rawprovidervssdkTypechoice across multiple services.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Given the subtle distinction between `provider`, `runtimeProvider`, and `sdkType`, consider tightening the types or renaming parameters in `API_ENDPOINTS` and call sites so it’s harder to accidentally pass the wrong identifier in the future.
- It may be helpful to add a small helper (e.g. `getProviderEndpointId(provider)` or similar) to centralize the mapping logic and avoid repeating the raw `provider` vs `sdkType` choice across multiple services.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #11335 +/- ##
=========================================
Coverage 76.40% 76.40%
=========================================
Files 1134 1134
Lines 87549 87549
Branches 11796 10275 -1521
=========================================
Hits 66892 66892
Misses 20581 20581
Partials 76 76
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
3fdeb9a to
b0c318e
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
a4c4039 to
dc114f3
Compare
Fixed custom AI Provider functionality by correcting API endpoint construction. Previously used sdkType/runtimeProvider (e.g., 'azure', 'openai') as the API path, causing server to query wrong provider configuration from database. Now correctly uses the original provider identifier, allowing custom providers to work with server-side APIs. Changes: - chat/index.ts: use provider for chat API endpoint - models.ts: use provider for models and modelPull API endpoints 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
dc114f3 to
5f172b7
Compare
|
❤️ Great PR @hardy-one ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
## [Version 2.0.0-next.244](v2.0.0-next.243...v2.0.0-next.244) <sup>Released on **2026-01-08**</sup> #### 🐛 Bug Fixes - **api**: Fix the issue where custom AI Providers cannot use custom APIs. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's fixed * **api**: Fix the issue where custom AI Providers cannot use custom APIs, closes [#11335](#11335) ([2c666b8](2c666b8)) </details> <div align="right"> [](#readme-top) </div>
|
🎉 This PR is included in version 2.0.0-next.244 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.151.0](v1.150.0...v1.151.0) <sup>Released on **2026-01-16**</sup> #### ♻ Code Refactoring - **agentGroup**: Simplify LobeChatGroupChatConfig schema. - **database**: Renamed to userMemories/index.ts. - **desktop**: Unify TITLE_BAR_HEIGHT constant to desktop-bridge. - **misc**: Improve Tools popover component structure and fix UI consistency, migrate Next.js navigation APIs to React Router for SPA, refactor page and notebook document usage, remove the old lobehub plugins, rename chat folder to agent, use fallbackData to prevent useActionSWR auto-fetch. #### ✨ Features - **community**: Recommendation for agent & Discover tab, recommended for home & added discover tab, support to report for agent & mcp plugin interaction for recommendation. - **conversation**: Use native context menu when selection is within current ChatItem. - **desktop**: Add desktop release service and API endpoint, add local update testing scripts and stable channel API version check, implement history navigation stack, improve macOS permission requests and Full Disk Access detection. - **electron**: Add custom titlebar for Electron windows. - **share**: Add topic sharing functionality. - **userMemories**: Support to assign for extra headers when invoking upstash workflows, support to use customized Qstash client with extra header for workflows. - **misc**: Add the agent cron job, generate `agent_cron_jobs` in agents, improve baseline alignment for tool items, improve group profile builder, improve group prompt context engine and fix group supervisor response issue, improve PageEditor header UX with DropdownMenu and i18n support, update model definitions and sync i18n, update the agent profiles tools check & agentbuilder tools & publish to market button, update the community user layout action button, update the cron job visiual way, update the cron patterns fields values. #### 🐛 Bug Fixes - **@upstash/qstash**: Should properly extract Error message from thrown one. - **api**: Fix the issue where custom AI Providers cannot use custom APIs. - **ChatInput**: Add missing MaxTokens setting to params popover. - **chat**: Reset activeTopicId when switching agent/group. - **controls**: Update checkbox toggle behavior and pass value to ParamControlWrapper. - **database**: Remove content validation limits for agent cron jobs. - **desktop**: Prevent duplicate CORS headers in response, return OFFICIAL_URL in cloud mode for remoteServerUrl selector, update macOS beta icon size for macOS 26. - **InputEditor**: Ensure lexical placeholder reactively updates on locale change. - **mcp**: Fix installation check hanging issue in desktop app. - **settings**: Add instant UI feedback for provider config switches. - **misc**: Click lobe ai topic trigger create new agent, fix auto add group member crash, fix duplicate agent and group, fix group ux and memory retriever, fix internal editor onTextChange issue and add test case, fix memory search context, fix new topic flick issue, fix page content mismatch when switch quickly, fix thread portal not open correctly, Fix Windows desktop build error with macOS native module, force plain text paste in ChatInput editor, handle will-prevent-unload event to allow app quit, prevent auto navigation to profile when clicking topic, refresh sidebar after sendAsGroup and add E2E tests, slove the settings/profile change but not refresh the profiles. #### 💄 Styles - **desktop**: Update macOS beta icon assets. - **misc**: Add MiniMax-M2.1 and GLM-4.7 for Qiniu provider, fix UI issues with tooltip wrapping and dropdown type, force gpt-5.2 use response api, improve agent loading state, improve cron jobs style, improve todo list, modelParse support to get model settings params & Customize extendParams UI, remember page agent panel width, update i18n, update i18n, update readFile content. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **agentGroup**: Simplify LobeChatGroupChatConfig schema, closes [lobehub#11431](https://github.com/jaworldwideorg/OneJA-Bot/issues/11431) ([a8c6b2c](a8c6b2c)) * **database**: Renamed to userMemories/index.ts, closes [lobehub#11359](https://github.com/jaworldwideorg/OneJA-Bot/issues/11359) ([9dae5ff](9dae5ff)) * **desktop**: Unify TITLE_BAR_HEIGHT constant to desktop-bridge, closes [lobehub#11496](https://github.com/jaworldwideorg/OneJA-Bot/issues/11496) ([e7739e5](e7739e5)) * **misc**: Improve Tools popover component structure and fix UI consistency, closes [lobehub#11356](https://github.com/jaworldwideorg/OneJA-Bot/issues/11356) ([f46837a](f46837a)) * **misc**: Migrate Next.js navigation APIs to React Router for SPA, closes [lobehub#11394](https://github.com/jaworldwideorg/OneJA-Bot/issues/11394) ([2253d46](2253d46)) * **misc**: Refactor page and notebook document usage, closes [lobehub#11345](https://github.com/jaworldwideorg/OneJA-Bot/issues/11345) ([88721eb](88721eb)) * **misc**: Remove the old lobehub plugins, closes [lobehub#11498](https://github.com/jaworldwideorg/OneJA-Bot/issues/11498) ([e5b47df](e5b47df)) * **misc**: Rename chat folder to agent, closes [lobehub#11409](https://github.com/jaworldwideorg/OneJA-Bot/issues/11409) ([7cfb1a3](7cfb1a3)) * **misc**: Use fallbackData to prevent useActionSWR auto-fetch, closes [lobehub#11514](https://github.com/jaworldwideorg/OneJA-Bot/issues/11514) ([d446163](d446163)) #### What's improved * **community**: Recommendation for agent & Discover tab, closes [lobehub#11445](https://github.com/jaworldwideorg/OneJA-Bot/issues/11445) ([5c102b5](5c102b5)) * **community**: Recommended for home & added discover tab, closes [lobehub#11290](https://github.com/jaworldwideorg/OneJA-Bot/issues/11290) ([8db248c](8db248c)) * **community**: Support to report for agent & mcp plugin interaction for recommendation, closes [lobehub#11289](https://github.com/jaworldwideorg/OneJA-Bot/issues/11289) ([6f98792](6f98792)) * **conversation**: Use native context menu when selection is within current ChatItem, closes [lobehub#11400](https://github.com/jaworldwideorg/OneJA-Bot/issues/11400) ([9778dce](9778dce)) * **desktop**: Add desktop release service and API endpoint, closes [lobehub#11520](https://github.com/jaworldwideorg/OneJA-Bot/issues/11520) ([e3dc5be](e3dc5be)) * **desktop**: Add local update testing scripts and stable channel API version check, closes [lobehub#11474](https://github.com/jaworldwideorg/OneJA-Bot/issues/11474) [lobehub#11513](https://github.com/jaworldwideorg/OneJA-Bot/issues/11513) ([959c210](959c210)) * **desktop**: Implement history navigation stack, closes [lobehub#11341](https://github.com/jaworldwideorg/OneJA-Bot/issues/11341) ([db270d5](db270d5)) * **desktop**: Improve macOS permission requests and Full Disk Access detection, closes [lobehub#11380](https://github.com/jaworldwideorg/OneJA-Bot/issues/11380) ([2d5868f](2d5868f)) * **electron**: Add custom titlebar for Electron windows, closes [lobehub#11438](https://github.com/jaworldwideorg/OneJA-Bot/issues/11438) ([08f6ee3](08f6ee3)) * **share**: Add topic sharing functionality, closes [lobehub#11448](https://github.com/jaworldwideorg/OneJA-Bot/issues/11448) ([ddca165](ddca165)) * **userMemories**: Support to assign for extra headers when invoking upstash workflows, closes [lobehub#11374](https://github.com/jaworldwideorg/OneJA-Bot/issues/11374) ([895e15e](895e15e)) * **userMemories**: Support to use customized Qstash client with extra header for workflows, closes [lobehub#11378](https://github.com/jaworldwideorg/OneJA-Bot/issues/11378) ([3417af4](3417af4)) * **misc**: Add the agent cron job, closes [lobehub#11370](https://github.com/jaworldwideorg/OneJA-Bot/issues/11370) ([10e47d9](10e47d9)) * **misc**: Generate `agent_cron_jobs` in agents, closes [lobehub#11349](https://github.com/jaworldwideorg/OneJA-Bot/issues/11349) ([eefb6cb](eefb6cb)) * **misc**: Improve baseline alignment for tool items, closes [lobehub#11447](https://github.com/jaworldwideorg/OneJA-Bot/issues/11447) ([be8dddd](be8dddd)) * **misc**: Improve group profile builder, closes [lobehub#11452](https://github.com/jaworldwideorg/OneJA-Bot/issues/11452) ([9012b40](9012b40)) * **misc**: Improve group prompt context engine and fix group supervisor response issue, closes [lobehub#11490](https://github.com/jaworldwideorg/OneJA-Bot/issues/11490) ([7d066eb](7d066eb)) * **misc**: Improve PageEditor header UX with DropdownMenu and i18n support, closes [lobehub#11462](https://github.com/jaworldwideorg/OneJA-Bot/issues/11462) ([ae499c9](ae499c9)) * **misc**: Update model definitions and sync i18n, closes [lobehub#11468](https://github.com/jaworldwideorg/OneJA-Bot/issues/11468) ([484ffb3](484ffb3)) * **misc**: Update the agent profiles tools check & agentbuilder tools & publish to market button, closes [lobehub#11501](https://github.com/jaworldwideorg/OneJA-Bot/issues/11501) ([85277fa](85277fa)) * **misc**: Update the community user layout action button, closes [lobehub#11472](https://github.com/jaworldwideorg/OneJA-Bot/issues/11472) ([2dd6d42](2dd6d42)) * **misc**: Update the cron job visiual way, closes [lobehub#11466](https://github.com/jaworldwideorg/OneJA-Bot/issues/11466) ([63d81de](63d81de)) * **misc**: Update the cron patterns fields values, closes [lobehub#11399](https://github.com/jaworldwideorg/OneJA-Bot/issues/11399) ([7632cef](7632cef)) #### What's fixed * **@upstash/qstash**: Should properly extract Error message from thrown one, closes [lobehub#11465](https://github.com/jaworldwideorg/OneJA-Bot/issues/11465) ([a8142b4](a8142b4)) * **api**: Fix the issue where custom AI Providers cannot use custom APIs, closes [lobehub#11335](https://github.com/jaworldwideorg/OneJA-Bot/issues/11335) ([2c666b8](2c666b8)) * **ChatInput**: Add missing MaxTokens setting to params popover, closes [lobehub#11412](https://github.com/jaworldwideorg/OneJA-Bot/issues/11412) [lobehub#11375](https://github.com/jaworldwideorg/OneJA-Bot/issues/11375) ([3db4389](3db4389)) * **chat**: Reset activeTopicId when switching agent/group, closes [lobehub#11523](https://github.com/jaworldwideorg/OneJA-Bot/issues/11523) ([fde54b0](fde54b0)) * **controls**: Update checkbox toggle behavior and pass value to ParamControlWrapper, closes [lobehub#11363](https://github.com/jaworldwideorg/OneJA-Bot/issues/11363) ([1f1ef94](1f1ef94)) * **database**: Remove content validation limits for agent cron jobs, closes [lobehub#11444](https://github.com/jaworldwideorg/OneJA-Bot/issues/11444) ([04a28d3](04a28d3)) * **desktop**: Prevent duplicate CORS headers in response, closes [lobehub#11350](https://github.com/jaworldwideorg/OneJA-Bot/issues/11350) ([57e725c](57e725c)) * **desktop**: Return OFFICIAL_URL in cloud mode for remoteServerUrl selector, closes [lobehub#11502](https://github.com/jaworldwideorg/OneJA-Bot/issues/11502) ([1d11fac](1d11fac)) * **desktop**: Update macOS beta icon size for macOS 26, closes [lobehub#11348](https://github.com/jaworldwideorg/OneJA-Bot/issues/11348) ([0d1eedf](0d1eedf)) * **InputEditor**: Ensure lexical placeholder reactively updates on locale change, closes [lobehub#11352](https://github.com/jaworldwideorg/OneJA-Bot/issues/11352) ([72e796b](72e796b)) * **mcp**: Fix installation check hanging issue in desktop app, closes [lobehub#11524](https://github.com/jaworldwideorg/OneJA-Bot/issues/11524) ([b9341c3](b9341c3)) * **settings**: Add instant UI feedback for provider config switches, closes [lobehub#11362](https://github.com/jaworldwideorg/OneJA-Bot/issues/11362) ([a758d01](a758d01)) * **misc**: Click lobe ai topic trigger create new agent, closes [lobehub#11508](https://github.com/jaworldwideorg/OneJA-Bot/issues/11508) ([2443189](2443189)) * **misc**: Fix auto add group member crash, closes [lobehub#11387](https://github.com/jaworldwideorg/OneJA-Bot/issues/11387) ([fe4ff91](fe4ff91)) * **misc**: Fix duplicate agent and group, closes [lobehub#11411](https://github.com/jaworldwideorg/OneJA-Bot/issues/11411) ([bc8aea4](bc8aea4)) * **misc**: Fix group ux and memory retriever, closes [lobehub#11481](https://github.com/jaworldwideorg/OneJA-Bot/issues/11481) ([033ca92](033ca92)) * **misc**: Fix internal editor onTextChange issue and add test case, closes [lobehub#11509](https://github.com/jaworldwideorg/OneJA-Bot/issues/11509) ([e5eb03e](e5eb03e)) * **misc**: Fix memory search context, closes [lobehub#11393](https://github.com/jaworldwideorg/OneJA-Bot/issues/11393) ([9f51a4c](9f51a4c)) * **misc**: Fix new topic flick issue, closes [lobehub#11473](https://github.com/jaworldwideorg/OneJA-Bot/issues/11473) ([c53d372](c53d372)) * **misc**: Fix page content mismatch when switch quickly, closes [lobehub#11505](https://github.com/jaworldwideorg/OneJA-Bot/issues/11505) ([0cb1374](0cb1374)) * **misc**: Fix thread portal not open correctly, closes [lobehub#11475](https://github.com/jaworldwideorg/OneJA-Bot/issues/11475) ([e6ff90b](e6ff90b)) * **misc**: Fix Windows desktop build error with macOS native module, closes [lobehub#11417](https://github.com/jaworldwideorg/OneJA-Bot/issues/11417) ([67a8114](67a8114)) * **misc**: Force plain text paste in ChatInput editor, closes [lobehub#11414](https://github.com/jaworldwideorg/OneJA-Bot/issues/11414) ([70daf13](70daf13)) * **misc**: Handle will-prevent-unload event to allow app quit, closes [lobehub#11406](https://github.com/jaworldwideorg/OneJA-Bot/issues/11406) ([cbeb013](cbeb013)) * **misc**: Prevent auto navigation to profile when clicking topic, closes [lobehub#11500](https://github.com/jaworldwideorg/OneJA-Bot/issues/11500) ([1e03005](1e03005)) * **misc**: Refresh sidebar after sendAsGroup and add E2E tests, closes [lobehub#11450](https://github.com/jaworldwideorg/OneJA-Bot/issues/11450) ([8376a80](8376a80)) * **misc**: Slove the settings/profile change but not refresh the profiles, closes [lobehub#11497](https://github.com/jaworldwideorg/OneJA-Bot/issues/11497) ([f1e2111](f1e2111)) #### Styles * **desktop**: Update macOS beta icon assets, closes [lobehub#11368](https://github.com/jaworldwideorg/OneJA-Bot/issues/11368) ([3623e58](3623e58)) * **misc**: Add MiniMax-M2.1 and GLM-4.7 for Qiniu provider, closes [lobehub#10982](https://github.com/jaworldwideorg/OneJA-Bot/issues/10982) ([695784d](695784d)) * **misc**: Fix UI issues with tooltip wrapping and dropdown type, closes [lobehub#11495](https://github.com/jaworldwideorg/OneJA-Bot/issues/11495) ([9d90eba](9d90eba)) * **misc**: Force gpt-5.2 use response api, closes [lobehub#11373](https://github.com/jaworldwideorg/OneJA-Bot/issues/11373) ([f7f3631](f7f3631)) * **misc**: Improve agent loading state, closes [lobehub#11511](https://github.com/jaworldwideorg/OneJA-Bot/issues/11511) ([3bb7f33](3bb7f33)) * **misc**: Improve cron jobs style, closes [lobehub#11420](https://github.com/jaworldwideorg/OneJA-Bot/issues/11420) ([d1602f6](d1602f6)) * **misc**: Improve todo list, closes [lobehub#11533](https://github.com/jaworldwideorg/OneJA-Bot/issues/11533) ([a4b71e9](a4b71e9)) * **misc**: ModelParse support to get model settings params & Customize extendParams UI, closes [lobehub#11185](https://github.com/jaworldwideorg/OneJA-Bot/issues/11185) ([94e985a](94e985a)) * **misc**: Remember page agent panel width, closes [lobehub#11389](https://github.com/jaworldwideorg/OneJA-Bot/issues/11389) ([801b624](801b624)) * **misc**: Update i18n, closes [lobehub#11425](https://github.com/jaworldwideorg/OneJA-Bot/issues/11425) ([87fbed2](87fbed2)) * **misc**: Update i18n, closes [lobehub#11360](https://github.com/jaworldwideorg/OneJA-Bot/issues/11360) ([da09825](da09825)) * **misc**: Update readFile content, closes [lobehub#11485](https://github.com/jaworldwideorg/OneJA-Bot/issues/11485) ([050499b](050499b)) </details> <div align="right"> [](#readme-top) </div>
💻 Change Type
🔗 Related Issue
Fixes #11296 Fixes #11271
🔀 Description of Change
修复自定义 AI Provider 无法使用服务端 API 的问题。
问题原因:
客户端使用 sdkType(如 'azure'、'openai')构建 API 端点路径,但服务端使用该路径作为 provider ID 从数据库查询配置。这导致服务端查询了内置 provider 的配置,而不是用户自定义 provider 的配置。
修复方案:
将 API 端点路径从使用 sdkType 改为使用原始的 provider 标识。这确保服务端能正确查询用户配置,然后从配置中读取 sdkType 来初始化相应的运行时。
修改文件:
src/services/chat/index.ts:聊天 API 端点使用 provider
src/services/models.ts:模型列表和模型拉取 API 端点使用 provider
为什么客户端模式之前能正常工作:
客户端模式不走服务器 API,而是直接在浏览器中通过 createPayloadWithKeyVaults(provider) 从 store 读取配置(使用原始 provider),然后使用 ModelRuntime.initializeWithProvider(runtimeProvider, ...) 选择 SDK(使用 sdkType)。两个参数职责清晰分离,不存在路径混淆问题。
🧪 How to Test
📸 Screenshots / Videos
📝 Additional Information
Summary by Sourcery
Ensure server-side AI API requests use the correct provider identifier for routing and configuration lookup.
Bug Fixes: