From 3c7dfc906fa15a0be67bde92faacfee154c0df94 Mon Sep 17 00:00:00 2001 From: lvxinyu-1117 Date: Thu, 7 Aug 2025 12:10:23 +0800 Subject: [PATCH] fix: correct userID propagation for plugin nodes in agent-run scene (#630) --- backend/crossdomain/workflow/plugin/plugin.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/crossdomain/workflow/plugin/plugin.go b/backend/crossdomain/workflow/plugin/plugin.go index 46595434..7f4ea090 100644 --- a/backend/crossdomain/workflow/plugin/plugin.go +++ b/backend/crossdomain/workflow/plugin/plugin.go @@ -332,8 +332,15 @@ func (t *pluginService) ExecutePlugin(ctx context.Context, input map[string]any, return nil, vo.WrapError(errno.ErrSerializationDeserializationFail, err) } + var uID string + if cfg.AgentID != nil { + uID = cfg.ConnectorUID + } else { + uID = conv.Int64ToStr(cfg.Operator) + } + req := &service.ExecuteToolRequest{ - UserID: conv.Int64ToStr(cfg.Operator), + UserID: uID, PluginID: pe.PluginID, ToolID: toolID, ExecScene: plugin.ExecSceneOfWorkflow,