fix: Cancel runs before a work-order rerun - #6908
Conversation
Replacing a traversal finished its factory execution but left the linked canvas run active. The old run could continue to use resources and cause side effects after the replacement started. Request cancellation before the execution releases its parallelism slot. Also refresh the default stop action when a mounted footer changes state. A failed run now selects its rerun action instead of retaining the prior Stop and Close choice. Signed-off-by: Aleksandar Mitrovic <alex@superplane.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
👋 Commands for maintainers:
|
|
Storybook available at https://pr-6908-storybook.superplane.workers.dev |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a3a8be4. Configure here.
| if err := run.MarkAsCancelling(tx, nil); err != nil { | ||
| return err | ||
| } | ||
| } |
There was a problem hiding this comment.
Rerun cancel does not drain runs
High Severity
settleOpenWorkFrom now calls MarkAsCancelling but never DrainForCancellation and does not publish the drain or run-state messages. Other cancel paths stop node executions, drop queue items, and notify workers immediately. Here the work-order slot is released and a replacement can start while the old canvas run keeps executing until the five-minute cancelling sweep, so a waiting or API-triggered rerun can still run two steps at once.
Reviewed by Cursor Bugbot for commit a3a8be4. Configure here.


Summary
A replaced traversal released its parallelism slot while its canvas run stayed active. This change requests cancellation before the replacement starts.
A mounted failed-run footer also retained its earlier Stop and Close selection. This change selects Rerun this step when the footer state changes.
Follow-up to #6899.
Made with Cursor