Repository navigation
Reject active thread starts before host readiness waits - #4038
Merged
Merged
Conversation
3 tasks done
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.
🚨 SLOP COP 🚨 ·
new-issue-autopilotHuman comments
What was wrong
Thread dispatch returned a suspended-host queue result before checking current thread state and rejecting an explicit start on an active thread. Both stale idle and fresh active snapshots could therefore queue instead of returning the existing 409 conflict. Reproduction report.
What changed
Refresh persisted state and reject active-thread starts before host readiness handling. Keep queue-if-active host waits in their existing order. Add regression coverage for stale and fresh snapshots, absence of queue/wake side effects, and the queue-if-active control.
Two files in server thread dispatch: 101 additions + 19 deletions = 120 changed text lines. No dependency, stored-data, or public protocol changes.
How you verified
b8866c6e1dbb1e9b043df3d4474178459a5b4f9a, the new start tests failed in two clean checkouts; the queue control passed in both.pnpm exec turbo run test --concurrency=2 --filter=@bb/server -- test/threads/thread-send-dispatch.test.ts test/threads/dispatch-hooks.test.ts test/threads/requested-queue-drain.test.ts test/threads/queue-drain-failure.test.ts --maxWorkers=2.pnpm exec turbo run typecheck --filter=@bb/serverandgit diff --checkpassed.Fixes #3987