-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(workflow): optimize loop/parallel regeneration and prevent duplicate agent tools #3100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryOptimized workflow store to skip expensive loop/parallel regeneration operations when they're not needed, and added duplicate prevention for agent tools. Major Changes:
Performance Impact: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant WorkflowStore
participant generateLoopBlocks
participant generateParallelBlocks
Note over WorkflowStore: Case 1: Add regular block (no parentId)
User->>WorkflowStore: addBlock(id, type='agent', ...)
WorkflowStore->>WorkflowStore: Check parentId (undefined)
WorkflowStore->>WorkflowStore: Create newBlocks
Note over WorkflowStore: Skip loop/parallel regeneration
WorkflowStore->>WorkflowStore: set({ loops: {...get().loops}, parallels: {...get().parallels} })
Note over WorkflowStore: Case 2: Add child to loop
User->>WorkflowStore: addBlock(id, type='function', parentId='loop-1')
WorkflowStore->>WorkflowStore: Check parentBlock type (loop)
WorkflowStore->>generateLoopBlocks: generateLoopBlocks(newBlocks)
generateLoopBlocks-->>WorkflowStore: Updated loops with child
WorkflowStore->>WorkflowStore: set({ loops: updatedLoops, parallels: {...get().parallels} })
Note over WorkflowStore: Case 3: Add edge
User->>WorkflowStore: batchAddEdges([edge])
WorkflowStore->>WorkflowStore: Validate and add edge
Note over WorkflowStore: Edges don't affect loop/parallel structure
WorkflowStore->>WorkflowStore: set({ loops: {...get().loops}, parallels: {...get().parallels} })
Note over WorkflowStore: Case 4: Batch add with mixed blocks
User->>WorkflowStore: batchAddBlocks([loop, child, regular])
WorkflowStore->>WorkflowStore: Check if any block.type === 'loop'
WorkflowStore->>WorkflowStore: Check if any block has parentId pointing to loop
WorkflowStore->>generateLoopBlocks: generateLoopBlocks(newBlocks)
generateLoopBlocks-->>WorkflowStore: Updated loops
WorkflowStore->>WorkflowStore: set({ loops: updatedLoops })
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Migrated undo-redo to use batchAddBlocks instead of addBlock loop - Removed addBlock method from workflow store (now unused) - Updated tests to use helper function wrapping batchAddBlocks - This fixes the cursor bot comments about inconsistent parent checking
Summary
Type of Change
Testing
Checklist