Skip to content

Conversation

@aadamgough
Copy link
Contributor

Summary

For loop was stuck at 100 instead of 1000, which is what it for each has as well as max_ters in constants.ts.

Type of Change

  • Bug fix

Testing

Manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Dec 16, 2025 11:54pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 16, 2025

Greptile Overview

Greptile Summary

Fixes inconsistent loop iteration limit by updating the maximum from 100 to 1000 across all affected files, aligning with the DEFAULTS.MAX_LOOP_ITERATIONS constant in executor/constants.ts.

  • Updated loop maxIterations config in use-subflow-editor.ts from 100 to 1000
  • Fixed clamp range in use-collaborative-workflow.ts and store.ts from 1-100 to 1-1000
  • Updated unit test to validate the corrected 1-1000 clamp behavior

Confidence Score: 5/5

  • This PR is safe to merge - it's a simple, consistent bug fix with updated tests.
  • All changes are straightforward constant updates from 100 to 1000 across 4 files. The fix aligns with the existing DEFAULTS.MAX_LOOP_ITERATIONS constant. Tests were properly updated to validate the new behavior.
  • No files require special attention.

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/hooks/use-subflow-editor.ts 5/5 Updated maxIterations config from 100 to 1000 for loops, aligning with DEFAULTS.MAX_LOOP_ITERATIONS constant.
apps/sim/hooks/use-collaborative-workflow.ts 5/5 Fixed loop iteration clamp range from 1-100 to 1-1000 for collaborative workflow updates.
apps/sim/stores/workflows/workflow/store.ts 5/5 Fixed loop count clamp range from 1-100 to 1-1000 in updateLoopCount action.
apps/sim/stores/workflows/workflow/store.test.ts 5/5 Updated test case to validate new 1-1000 clamp range for loop counts.

Sequence Diagram

sequenceDiagram
    participant User
    participant SubflowEditor as use-subflow-editor
    participant CollabWorkflow as use-collaborative-workflow
    participant Store as workflow/store

    User->>SubflowEditor: Set loop count (e.g., 500)
    SubflowEditor->>SubflowEditor: Validate against maxIterations (1000)
    SubflowEditor->>CollabWorkflow: collaborativeUpdateIterationCount()
    CollabWorkflow->>CollabWorkflow: Clamp between 1-1000
    CollabWorkflow->>Store: updateLoopCount()
    Store->>Store: Clamp between 1-1000
    Store-->>CollabWorkflow: Updated state
    CollabWorkflow-->>SubflowEditor: Sync complete
    SubflowEditor-->>User: UI updated
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 changed the title fix(loop): increased loop to 1000 fix(loop): increased max loop iterations to 1000 Dec 16, 2025
@aadamgough aadamgough merged commit 6f4f4e2 into staging Dec 17, 2025
10 checks passed
@aadamgough aadamgough deleted the fix/loop branch December 17, 2025 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants