fix(terminal): terminal console update for child spans + hitl state machine#4450
fix(terminal): terminal console update for child spans + hitl state machine#4450icecrasher321 merged 6 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Reconnect stream correctness: Cancellation + HITL state machine: cancel endpoint now supports a paused-execution cancellation flow ( Client terminal/recovery fixes: SSE processing now awaits event handlers before acknowledging Executor resume edge-case: execution engine skips starter-block fallback when resuming from a snapshot with no downstream work. Reviewed by Cursor Bugbot for commit 6af6598. Configure here. |
Greptile SummaryThis PR overhauls the terminal console update pipeline and HITL state machine to eliminate race conditions: child-workflow span reconciliation is replaced with
Confidence Score: 4/5The core reconnect and terminal-log race fixes are sound; the main concern is the complexity of the new two-phase HITL cancellation path, which has an edge case in status rollback logic. The PR correctly addresses the two main defects called out in prior review threads (stuck running entries after non-retryable reconnect, and child-span field mismatch silencing reconciliation). The new apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts — the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Cancel Request] --> B{isPausedCancellationPath?}
B -- Yes --> C[beginPausedCancellation]
C --> D{activeResume claimed?}
D -- No --> E[status = cancelling, return true]
D -- Yes --> F[status = cancelling, return false]
F --> G[getPausedCancellationStatus]
G -- null active claim --> H[fall to Redis cancel path]
E --> I[ensurePausedCancellationEventPublished]
I -- success --> J[completePausedCancellationWithRetry]
I -- fail --> K[clearPausedCancellationIntent]
J --> L[respond success:true]
B -- No --> M[markExecutionCancelled via Redis]
M --> N[abortManualExecution]
N --> O[respond success: durablyRecorded OR locallyAborted]
Reviews (4): Last reviewed commit: "address greptile" | Re-trigger Greptile |
|
bugbot run |
|
@greptile |
|
bugbot run |
|
@greptile |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 6af6598. Configure here.
|
@greptile |

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.
Also fix hitl state machine to not leave executions stuck in wrong state.
Type of Change
Testing
Tested manually
Checklist