Skip to content

Commit

Permalink
fix: optimize tool node check in workflow (labring#3002)
Browse files Browse the repository at this point in the history
* fix: optimize tool node check in workflow

* comment
  • Loading branch information
newfish-cmyk authored and shilin66 committed Dec 11, 2024
1 parent b3a44d6 commit 4809640
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions projects/app/src/web/core/workflow/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,16 @@ export const checkWorkflowNodeAndConnection = ({
return [data.nodeId];
}

// check empty node(not edge)
const hasEdge = edges.some(
// filter tools node edge
const edgeFilted = edges.filter(
(edge) =>
!(
data.flowNodeType === FlowNodeTypeEnum.tools &&
edge.sourceHandle === NodeOutputKeyEnum.selectedTools
)
);
// check node has edge
const hasEdge = edgeFilted.some(
(edge) => edge.source === data.nodeId || edge.target === data.nodeId
);
if (!hasEdge) {
Expand Down

0 comments on commit 4809640

Please sign in to comment.