refactor: remove agent ID references from AI workflow handling and related components

This commit is contained in:
mlogclub
2026-07-25 15:32:55 +08:00
parent 7b86fd1f09
commit 1663db7f24
14 changed files with 13 additions and 302 deletions
+2 -2
View File
@@ -437,7 +437,7 @@ func (s *channelService) buildChannelModel(id int64, req request.CreateChannelRe
return nil, errorsx.InvalidParamI18n("error.e0004")
}
if aiAgent.RuntimeMode == "" || aiAgent.RuntimeMode == enums.AIAgentRuntimeModeWorkflow {
if aiAgent.WorkflowVersionID <= 0 {
if len(AIAgentService.ListEnabledWorkflowBindings(sqls.DB(), aiAgent.ID)) != 1 {
return nil, errorsx.InvalidParam("ai agent workflow must be published before binding channel")
}
} else if aiAgent.RuntimeMode == enums.AIAgentRuntimeModeAutonomous {
@@ -445,7 +445,7 @@ func (s *channelService) buildChannelModel(id int64, req request.CreateChannelRe
return nil, errorsx.InvalidParam("autonomous ai agent must be published before binding channel")
}
} else if aiAgent.RuntimeMode == enums.AIAgentRuntimeModeHybrid {
if aiAgent.PublishedRevisionID <= 0 || aiAgent.WorkflowVersionID <= 0 {
if aiAgent.PublishedRevisionID <= 0 {
return nil, errorsx.InvalidParam("hybrid ai agent and workflow must be published before binding channel")
}
} else {