fix(supervisor): serialize cancellation and terminal job state - #82
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 557290f9d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
## [4.1.1](v4.1.0...v4.1.1) (2026-09-08) ### Bug Fixes * **supervisor:** serialize cancellation and terminal job state ([#82](#82)) ([450b64e](450b64e))
Problem and behavior
Cancelling a supervisor job could return
cancelledwhile the run promise and persisted job ended asfailed. The cancellation path killed the process before saving its state, allowing the exit path to race it with a second terminal write.The runner now claims one terminal outcome synchronously and shares its persistence promise between cancellation and process exit. The service delegates cancellation to that owner. Accepted repeated requests reuse one outcome/event, and cancellation after completion has claimed its outcome returns
not_running. A successful cancel response waits for metadata and the cancellation event, without waiting for process exit or output drain. Ordinary completion, nonzero failure, and API response shapes remain intact.Persistence failures after a terminal claim now reject and are logged without allowing the service fallback to overwrite the claimed outcome. Partial metadata/event writes remain visible as errors; they are not reported as success or automatically retried.
Validation
Expected: cancelled / Received: failedin the regression tests.73b1be7f16b5195bcd895bafb2675a5519ab5f7e.Release
fix(supervisor)should produce a patch release. This repairs retained supervisor behavior and does not promote unsupported remote workflows into the default product. Follow-up source: project writeback WB-00004.