Skip to content

Commit e46045d

Browse files
authored
improvement(console): increase console max entries for larger workflows (#1032)
* improvement(console): increase console max entries for larger workflows * increase safety limit for infinite loops
1 parent 81969f1 commit e46045d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ export function useWorkflowExecution() {
807807

808808
// Continue execution until there are no more pending blocks
809809
let iterationCount = 0
810-
const maxIterations = 100 // Safety to prevent infinite loops
810+
const maxIterations = 500 // Safety to prevent infinite loops
811811

812812
while (currentPendingBlocks.length > 0 && iterationCount < maxIterations) {
813813
logger.info(

apps/sim/executor/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export class Executor {
225225

226226
let hasMoreLayers = true
227227
let iteration = 0
228-
const maxIterations = 100 // Safety limit for infinite loops
228+
const maxIterations = 500 // Safety limit for infinite loops
229229

230230
while (hasMoreLayers && iteration < maxIterations && !this.isCancelled) {
231231
const nextLayer = this.getNextExecutionLayer(context)

apps/sim/stores/panel/console/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { redactApiKeys } from '@/lib/utils'
44
import type { NormalizedBlockOutput } from '@/executor/types'
55
import type { ConsoleEntry, ConsoleStore } from '@/stores/panel/console/types'
66

7-
const MAX_ENTRIES = 50 // MAX across all workflows
7+
const MAX_ENTRIES = 500 // MAX across all workflows - allows for 100 loop iterations + other workflow logs
88
const MAX_IMAGE_DATA_SIZE = 1000 // Maximum size of image data to store (in characters)
99
const MAX_ANY_DATA_SIZE = 5000 // Maximum size of any data to store (in characters)
1010
const MAX_TOTAL_ENTRY_SIZE = 50000 // Maximum size of entire entry to prevent localStorage overflow

apps/sim/stores/workflows/workflow/store.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('workflow store', () => {
109109
expect(state.loops.loop1.forEachItems).toEqual(['item1', 'item2', 'item3'])
110110
})
111111

112-
it('should clamp loop count between 1 and 50', () => {
112+
it('should clamp loop count between 1 and 100', () => {
113113
const { addBlock, updateLoopCount } = useWorkflowStore.getState()
114114

115115
// Add a loop block
@@ -199,7 +199,7 @@ describe('workflow store', () => {
199199
expect(parsedDistribution).toHaveLength(3)
200200
})
201201

202-
it('should clamp parallel count between 1 and 50', () => {
202+
it('should clamp parallel count between 1 and 20', () => {
203203
const { addBlock, updateParallelCount } = useWorkflowStore.getState()
204204

205205
// Add a parallel block

0 commit comments

Comments
 (0)