Skip to content

improvement(console): added iteration info to console entry for parallel/loop#930

Merged
waleedlatif1 merged 1 commit intostagingfrom
improvement/console
Aug 10, 2025
Merged

improvement(console): added iteration info to console entry for parallel/loop#930
waleedlatif1 merged 1 commit intostagingfrom
improvement/console

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

Added iteration count to the parallell & loop console entries

Type of Change

  • New feature

Testing

Tested 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)
image

@vercel
Copy link

vercel bot commented Aug 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim 🔄 Building (Inspect) Visit Preview 💬 Add feedback Aug 10, 2025 11:27pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Aug 10, 2025 11:27pm

@waleedlatif1 waleedlatif1 merged commit e271ed8 into staging Aug 10, 2025
2 of 4 checks passed
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.

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:

  1. UI Enhancement: Modified the ConsoleEntry component to display iteration information when available, showing current/total iterations in a styled tag
  2. Type Definitions: Extended the ConsoleEntry interface with three optional properties: iterationCurrent, iterationTotal, and iterationType
  3. Loop Detection: Added a public getContainingLoopId method to the InputResolver class to efficiently identify if a block is executing within a loop context
  4. 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

Edit Code Review Bot Settings | Greptile

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.

1 participant