improvement(console): added iteration info to console entry for parallel/loop#930
improvement(console): added iteration info to console entry for parallel/loop#930waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Greptile Summary
This PR adds iteration tracking to console entries for parallel and loop blocks in the workflow execution system. The feature displays iteration progress (e.g., "1/5") directly in the console UI, making it easier for users to track execution flow and debug issues in iterative processes.
The implementation involves four key changes:
- UI Enhancement: Modified the
ConsoleEntrycomponent to display iteration information when available, showing current/total iterations in a styled tag - Type Definitions: Extended the
ConsoleEntryinterface with three optional properties:iterationCurrent,iterationTotal, anditerationType - Loop Detection: Added a public
getContainingLoopIdmethod to theInputResolverclass to efficiently identify if a block is executing within a loop context - Execution Tracking: Integrated iteration context determination into the executor's console logging system at three execution points (streaming, regular, and error paths)
The feature leverages existing workflow metadata about loops and parallel execution to calculate iteration counts. For parallel blocks, it uses the parallel execution index and total count. For loops, it determines the containing loop and calculates totals based on loop type - forEach loops count items in arrays/objects while regular loops use the configured iteration count.
This enhancement fits naturally into the existing console architecture, building upon the established pattern of conditional rendering for status indicators and tags. The implementation maintains backward compatibility through optional properties and doesn't affect existing console functionality.
Confidence score: 4/5
- This PR is generally safe to merge with good implementation patterns and clear user benefit
- Score reflects well-structured code changes but has some code duplication and minor type safety considerations
- Pay attention to the executor file which contains duplicated iteration logic across three execution paths
4 files reviewed, 2 comments
Summary
Added iteration count to the parallell & loop console entries
Type of Change
Testing
Tested manually
Checklist