fix(provider): sync providers_config after creating new provider (#6388)
Fixes #6283 When adding a new embedding provider, the knowledge base creation page did not show the new provider until restart. Root cause: create_provider() did not update self.providers_config, which is used by get_provider_config_list() to return provider lists. This fix syncs the in-memory config after loading the new provider, consistent with how reload() handles config updates. Co-authored-by: ccsang <ccsang@users.noreply.github.com>
This commit is contained in:
@@ -808,6 +808,8 @@ class ProviderManager:
|
||||
config.save_config()
|
||||
# load instance
|
||||
await self.load_provider(new_config)
|
||||
# sync in-memory config for API queries (e.g., embedding provider list)
|
||||
self.providers_config = astrbot_config["provider"]
|
||||
|
||||
async def terminate(self) -> None:
|
||||
if self._mcp_init_task and not self._mcp_init_task.done():
|
||||
|
||||
Reference in New Issue
Block a user