Repository navigation
Allow Work continuation after stopping a prepared worker - #172
Merged
Merged
Conversation
This was referenced Nov 25, 2026
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.
Fixes #171
After
worker-run preparefollowed byworker-run stopwith no intervening launch, SQLite keeps the original attempt in the prepared phase and records its public status as cancelled. The continuation guard now recognizes this state when collection is pending and both the launch token and process identity are absent. It then checks the applicable Workplace leases. This allows creating and resuming a v2 continuation for the same run, assignment and context.The release regression exercises a real prepare and stop, an active lease on the cancelled attempt, successful continuation after lease release and a newly prepared attempt that blocks resume again. The English and Russian continuation guides describe this behavior.
The previous read-only investigation reproduced the problem on public 1.3.0 and the 1.3.1 snapshot. The integration base
534ecbb2reproduced it again with the project's installed launcher and a registered driver. The same four issue commands returned a v2 continuation and the original run, assignment and context on1b9646b25564590be1a0eb77ac078d58f321ad4e. This was verified on Windows and Ubuntu under WSL2.The regression and the expanded issue scenario passed on both systems. CLI, stdio MCP and a temporary HTTP App Server each created and resumed the selected Work. A matching active lease returned
active_leasefor both operations. Nine inconsistent or busy record cases and a genuinely running worker were rejected. Retrying an interrupted Work cancellation completed successfully and preserved the worker attempt.The four adjacent pytest modules passed 223 tests on Windows with one Linux-specific skip and all 224 on Linux tmpfs. Two SQLite concurrency tests exceeded their contention budget on the local WSL2 ext4 disk on both the base and candidate. Both passed on the native Ubuntu runner. The released continuation regression can be run with
python -B tools/smoke_continuation_work.py. Native Ubuntu checks