fix(loop): increased max loop iterations to 1000 (#2413)

This commit is contained in:
Adam Gough
2025-12-16 16:08:56 -08:00
committed by GitHub
parent f7d2c9667f
commit 6f4f4e22f0
4 changed files with 6 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ const SUBFLOW_CONFIG = {
},
typeKey: 'loopType' as const,
storeKey: 'loops' as const,
maxIterations: 100,
maxIterations: 1000,
configKeys: {
iterations: 'iterations' as const,
items: 'forEachItems' as const,

View File

@@ -1540,7 +1540,7 @@ export function useCollaborativeWorkflow() {
const config = {
id: nodeId,
nodes: childNodes,
iterations: Math.max(1, Math.min(100, count)), // Clamp between 1-100 for loops
iterations: Math.max(1, Math.min(1000, count)), // Clamp between 1-1000 for loops
loopType: currentLoopType,
forEachItems: currentCollection,
}

View File

@@ -109,7 +109,7 @@ describe('workflow store', () => {
expect(state.loops.loop1.forEachItems).toEqual(['item1', 'item2', 'item3'])
})
it('should clamp loop count between 1 and 100', () => {
it('should clamp loop count between 1 and 1000', () => {
const { addBlock, updateLoopCount } = useWorkflowStore.getState()
// Add a loop block
@@ -126,9 +126,9 @@ describe('workflow store', () => {
)
// Try to set count above max
updateLoopCount('loop1', 150)
updateLoopCount('loop1', 1500)
let state = useWorkflowStore.getState()
expect(state.blocks.loop1?.data?.count).toBe(100)
expect(state.blocks.loop1?.data?.count).toBe(1000)
// Try to set count below min
updateLoopCount('loop1', 0)

View File

@@ -850,7 +850,7 @@ export const useWorkflowStore = create<WorkflowStore>()(
...block,
data: {
...block.data,
count: Math.max(1, Math.min(100, count)), // Clamp between 1-100
count: Math.max(1, Math.min(1000, count)), // Clamp between 1-1000
},
},
}