Skip to content

fix(runtime): add stoppedByCancellation status for proper cancellation handling#457

Merged
FL4TLiN3 merged 2 commits intomainfrom
fix/cancellation-status-handling
Feb 2, 2026
Merged

fix(runtime): add stoppedByCancellation status for proper cancellation handling#457
FL4TLiN3 merged 2 commits intomainfrom
fix/cancellation-status-handling

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Feb 1, 2026

Summary

  • Add stoppedByCancellation status to CheckpointStatus and JobStatus types
  • Update coordinator.ts to set status: "stoppedByCancellation" when shouldContinueRun returns false
  • Add case "stoppedByCancellation" in run.ts to handle the cancellation terminal state
  • Add tests for resumption from stoppedByCancellation status

Problem

When shouldContinueRun returns false (cancellation), coordinator.ts was returning the checkpoint without changing its status (init or proceeding). The run.ts switch statement didn't handle these statuses, falling to the default case and throwing "Run stopped by unknown reason" error.

Solution

Added stoppedByCancellation status to properly handle cancellation. This status is resumable via the default case in init.ts (same as other resumable statuses like completed, proceeding).

Test plan

  • Unit tests for stoppedByCancellation terminal state handling in run.test.ts
  • Unit test for stoppedByCancellation status being set in coordinator.test.ts
  • Unit test for resumption from stoppedByCancellation in init.test.ts

🤖 Generated with Claude Code

FL4TLiN3 and others added 2 commits February 1, 2026 22:40
…n handling

When shouldContinueRun returns false, the coordinator now sets the checkpoint
status to stoppedByCancellation. This allows the run loop to properly handle
the cancellation case and update the job status accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change RuntimeVersion from literal "v1.0" to pattern `v${number}.${number}`
- Split runtime-version E2E tests to use separate config for future version tests
- This allows testing version validation failures without breaking other tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 merged commit 17a2cf5 into main Feb 2, 2026
9 checks passed
@FL4TLiN3 FL4TLiN3 mentioned this pull request Feb 2, 2026
@FL4TLiN3 FL4TLiN3 deleted the fix/cancellation-status-handling branch February 25, 2026 13:36
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