fix(model): preserve UUID when updating LLM and embedding models in runtime

Agent-Logs-Url: https://github.com/langbot-app/LangBot/sessions/ffaa444c-501a-41ef-bf8b-d2cdef3b7625

Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-19 14:34:44 +00:00
committed by GitHub
parent 4c7ee6a9c9
commit eefb0ddde1
2 changed files with 272 additions and 264 deletions

View File

@@ -173,7 +173,7 @@ class LLMModelsService:
raise Exception('provider not found')
runtime_llm_model = await self.ap.model_mgr.load_llm_model_with_provider(
persistence_model.LLMModel(**model_data),
persistence_model.LLMModel(uuid=model_uuid, **model_data),
runtime_provider,
)
self.ap.model_mgr.llm_models.append(runtime_llm_model)
@@ -334,7 +334,7 @@ class EmbeddingModelsService:
raise Exception('provider not found')
runtime_embedding_model = await self.ap.model_mgr.load_embedding_model_with_provider(
persistence_model.EmbeddingModel(**model_data),
persistence_model.EmbeddingModel(uuid=model_uuid, **model_data),
runtime_provider,
)
self.ap.model_mgr.embedding_models.append(runtime_embedding_model)