mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
fix(framework): fail module registration on duplicate moduleName in AgentContext
This commit is contained in:
@@ -74,6 +74,12 @@ class ComponentRegisterFactory : AgentBaseFactory() {
|
||||
modelPromptMap: Map<String, List<Message>>,
|
||||
defaultConfig: ModelConfig
|
||||
) {
|
||||
if (agentContext.modules.containsKey(module.moduleName)) {
|
||||
throw ModuleFactoryInitFailedException(
|
||||
"模块注册失败, 存在重复 moduleName: ${module.moduleName} (class=${componentClass.name})"
|
||||
)
|
||||
}
|
||||
|
||||
val launchTime = ZonedDateTime.now()
|
||||
val modelInfo = if (module is ActivateModel) {
|
||||
val modelKey = module.modelKey()
|
||||
|
||||
Reference in New Issue
Block a user