fix: preserve Codex background delivery wakeups during worker exit - #2
Merged
Conversation
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.
Root cause
The post-merge Windows contract exposed a genuine outbox lost-wakeup race. A producer could enqueue a record while the drainer still owned its lock but had already decided to exit. Its wakeup marker was left behind, requiring another host event before delivery.
Fix
Proof and validation
A deterministic child-process filesystem-gate test fails on the old code (
0 !== 1) and passes both race interleavings with the fix. Repeated three times; 20 simultaneous producers tested. Full local Codex/Claude Code verification passes, along with transient-retry and terminal-failure regression tests. Refreshes the verified 235-entry Codex archive metadata.The standalone Windows memory-backend ZIP, DSH tarball and generic MCPB are unchanged. Already published tags/assets are preserved. The standalone Codex release is still independently blocked by the documented official scanner false positives; this PR does not disable that gate.