fix(web): make iteration panel respect MAX_PARALLEL_LIMIT environment variable (#23083) (#23104)

This commit is contained in:
lyzno1
2025-07-29 21:39:40 +08:00
committed by GitHub
parent ea542d42ca
commit 6914c1c85e
5 changed files with 319 additions and 20 deletions

View File

@@ -30,7 +30,6 @@ import {
} from '../utils'
import {
PARALLEL_DEPTH_LIMIT,
PARALLEL_LIMIT,
SUPPORT_OUTPUT_VARS_NODE,
} from '../constants'
import { CUSTOM_NOTE_NODE } from '../note-node/constants'
@@ -48,6 +47,7 @@ import { CUSTOM_ITERATION_START_NODE } from '@/app/components/workflow/nodes/ite
import { CUSTOM_LOOP_START_NODE } from '@/app/components/workflow/nodes/loop-start/constants'
import { basePath } from '@/utils/var'
import { canFindTool } from '@/utils'
import { MAX_PARALLEL_LIMIT } from '@/config'
export const useIsChatMode = () => {
const appDetail = useAppStore(s => s.appDetail)
@@ -270,8 +270,6 @@ export const useWorkflow = () => {
})
setNodes(newNodes)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [store])
const isVarUsedInNodes = useCallback((varSelector: ValueSelector) => {
@@ -310,9 +308,9 @@ export const useWorkflow = () => {
edges,
} = store.getState()
const connectedEdges = edges.filter(edge => edge.source === nodeId && edge.sourceHandle === nodeHandle)
if (connectedEdges.length > PARALLEL_LIMIT - 1) {
if (connectedEdges.length > MAX_PARALLEL_LIMIT - 1) {
const { setShowTips } = workflowStore.getState()
setShowTips(t('workflow.common.parallelTip.limit', { num: PARALLEL_LIMIT }))
setShowTips(t('workflow.common.parallelTip.limit', { num: MAX_PARALLEL_LIMIT }))
return false
}