fix(terminal): thread executionOrder through child workflow SSE events for loop support#3346
Merged
waleedlatif1 merged 4 commits intostagingfrom Feb 26, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…s for loop support
a95624d to
a0822dc
Compare
Contributor
Greptile SummaryThis PR threads Key Changes:
Impact: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant BE as BlockExecutor
participant WH as WorkflowHandler
participant SSE as SSE Events
participant Hook as useWorkflowExecution
participant Store as ConsoleStore
BE->>BE: createBlockLog(executionOrder)
BE->>BE: Build nodeMetadata with executionOrder
BE->>WH: executeWithNode(nodeMetadata)
WH->>WH: Extract executionOrder from nodeMetadata
WH->>SSE: onChildWorkflowInstanceReady(blockId, instanceId, iterationContext, executionOrder)
SSE->>SSE: Spread executionOrder into event data
SSE->>Hook: block:childWorkflowStarted event
Hook->>Hook: Extract executionOrder from event data
Hook->>Store: updateConsole(blockId, {executionOrder, ...})
Store->>Store: matchesEntryForUpdate checks executionOrder + childWorkflowBlockId
Store->>Store: Update correct entry for loop iteration
Last reviewed commit: 42127d2 |
…kflow block expansion IterationNodeRow was rendering all children as flat BlockRow components, ignoring nodeType. Workflow blocks inside loop iterations were never rendered as WorkflowNodeRow, so they had no expand chevron or child tree.
Sub-executors reset executionOrderCounter, so child blocks across loop iterations share the same blockId + executionOrder. Without checking childWorkflowBlockId, updateConsole for iteration N overwrites entries from iterations 0..N-1, causing all child blocks to be grouped under the last iteration's workflow instance.
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
executionOrderthrough theblock:childWorkflowStartedSSE event chain soupdateConsolecan precisely target the correct console entry per loop iterationblockId, sochildWorkflowInstanceIdfrom later iterations overwrites earlier ones, breaking the expandable child workflow treeType of Change
Testing
Tested manually
Checklist