fix(cli): make shell cancel race-safe with uninterruptible setup#8924
Closed
shssoichiro wants to merge 1 commit intoKilo-Org:mainfrom
Closed
fix(cli): make shell cancel race-safe with uninterruptible setup#8924shssoichiro wants to merge 1 commit intoKilo-Org:mainfrom
shssoichiro wants to merge 1 commit intoKilo-Org:mainfrom
Conversation
Shell cancel was flaky because the fiber could be interrupted before messages were persisted to the database, causing lastAssistant to throw "Impossible". Also, the finish cleanup only covered the spawn phase, leaving tool parts stuck in "running" state when the interrupt landed between setup and spawn. Wrap setup in uninterruptibleMask and use acquireUseRelease to guarantee the finish release runs on every exit path, including immediate interrupts that arrive before the spawn phase starts.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.4-20260305 · 435,893 tokens |
Collaborator
|
Hi @shssoichiro thanks for the fix. But we are quite careful on any changes in this direction at the moment. We will take care of the test issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shell cancel was flaky because the fiber could be interrupted before messages were persisted to the database, causing
lastAssistantto throw "Impossible". Also, the finish cleanup only covered the spawn phase, leaving tool parts stuck in "running" state when the interrupt landed between setup and spawn.Wrap setup in
uninterruptibleMaskand useacquireUseReleaseto guarantee the finish release runs on every exit path, including immediate interrupts that arrive before the spawn phase starts.How to Test
Run the following 3 tests, which are flaky in
main, repeatedly in a loop:Expected behavior: 100% pass rate (observed on this branch)
Get in Touch
ExpedientFalcon on Discord