fix(terminal): terminal console update for child spans#4450
fix(terminal): terminal console update for child spans#4450icecrasher321 wants to merge 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Fixes reconnect/log replay edge cases by deduping block start rows (matching iteration + parent-iteration identity) and by only clearing execution entries on reconnect when replay starts from Enhances final log reconciliation to match entries by Reviewed by Cursor Bugbot for commit a300077. Configure here. |
Greptile SummaryThis PR fixes a set of terminal console race conditions that caused child workflow errors, error-path blocks, reconnect replays, and scoped cancellations to display stale or duplicate rows. The core strategy is to scope
Confidence Score: 3/5Safe to merge for simple workflows; child workflows that contain loop blocks will see all loop-iteration rows overwritten with the same span data The new reconcileChildTraceSpans function calls updateConsole without iteration-discriminating fields (iterationCurrent, iterationContainerId), so for a child workflow that uses a loop, every per-iteration console row for the same block matches and gets stamped with the same final-span output. The TraceSpan type already carries iterationIndex and loopId that would fix this, but they are not forwarded. The remaining changes are correct and well-tested. apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts — specifically the reconcileChildTraceSpans function and its updateConsole calls Important Files Changed
Sequence DiagramsequenceDiagram
participant Executor
participant ExecutionCore
participant EventBuffer
participant LifecycleCallbacks
participant ConsoleStore
Executor->>ExecutionCore: execute()
loop Per block
ExecutionCore->>EventBuffer: write(block:started) [queued via writeQueue]
EventBuffer-->>ExecutionCore: eventId (ordered)
ExecutionCore->>LifecycleCallbacks: trackLifecycleCallback(onBlockStart)
ExecutionCore->>EventBuffer: write(block:completed) [queued]
EventBuffer-->>ExecutionCore: eventId (ordered)
ExecutionCore->>LifecycleCallbacks: trackLifecycleCallback(onBlockComplete)
end
Executor-->>ExecutionCore: ExecutionResult
ExecutionCore->>LifecycleCallbacks: waitForLifecycleCallbacks()
LifecycleCallbacks-->>ExecutionCore: all callbacks settled
ExecutionCore->>ConsoleStore: reconcileFinalBlockLogs(finalBlockLogs)
note over ConsoleStore: Updates running entries + child trace spans
ExecutionCore->>ConsoleStore: cancelRunningEntries(workflowId, executionId)
note over ConsoleStore: Only cancels entries for THIS executionId
ExecutionCore-->>Executor: final result
|
Summary
Fix terminal log races so child workflow errors, error-path executions, reconnect replays, and scoped cancellations preserve the correct final block status instead of showing stale canceled or duplicate rows.
Type of Change
Testing
Tested manually
Checklist