Skip to content

Reject active thread starts before host readiness waits - #4038

Merged
SawyerHood merged 1 commit into
mainfrom
slopcop/issue-3987
Sep 22, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
slopcop/issue-3987

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · new-issue-autopilot

Human 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

  • On trusted main b8866c6e1dbb1e9b043df3d4474178459a5b4f9a, the new start tests failed in two clean checkouts; the queue control passed in both.
  • After the fix, all 118 tests passed across thread-send-dispatch, dispatch-hooks, requested-queue-drain, and queue-drain-failure using 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/server and git diff --check passed.
  • An initial post-fix invocation hit a prerequisite process-start failure before running tests; reduced concurrency resolved it.

Fixes #3987

AGENT GENERATED

@SawyerHood
SawyerHood merged commit c257bd8 into main Sep 22, 2026
16 checks passed
@SawyerHood
SawyerHood deleted the slopcop/issue-3987 branch September 22, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mode:start can queue after the thread becomes active while its host is suspended

1 participant