Skip to content

Keep grouped queued prompts atomic - #2821

Merged
ymichael merged 1 commit into
mainfrom
bb/fixer-keep-grouped-queued-prompts-atomic-thr_sshib6bv4r
Sep 1, 2026
Merged

Keep grouped queued prompts atomic#2821
ymichael merged 1 commit into
mainfrom
bb/fixer-keep-grouped-queued-prompts-atomic-thr_sshib6bv4r

Conversation

@ymichael

@ymichael ymichael commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The durable queue stored prompt grouping separately from per-row wait eligibility. Scheduled and plugin-requested sweeps enumerated eligible row references and then claimed by one row ID. When a grouped prompt was postponed, only its lead row received the new wait, so a later row could retain an earlier deadline; after the pacing window expired, a later sweep could claim that follower alone, sever the group, and send an incomplete prompt. This follows up on the unified dispatch queue landing.

What changed

Queue persistence now accepts a whole-group eligibility check and evaluates it inside the same immediate transaction that claims the rows. Automatic scheduled and plugin-requested drains claim the complete group even when a sweep begins from a follower, and requeueing applies the same wait state to every claimed group member. Explicit Send now behavior remains unchanged. There are no wire, schema, CLI, SDK, guide, or documentation contract changes, so no host-daemon protocol bump is needed.

How you verified

The new production service/DB regression failed before the fix by recording a turn containing only tail while leaving lead queued, and passes after the fix.

  • pnpm exec turbo run test --filter=@bb/server -- --run test/threads/requested-queue-drain.test.ts — 6 passed
  • pnpm exec turbo run test --filter=@bb/db -- --run test/data/queued-thread-messages.test.ts — 30 passed
  • pnpm exec turbo run typecheck --filter=@bb/server
  • pnpm exec turbo run typecheck --filter=@bb/db
  • pnpm exec turbo run build --filter=@bb/server

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/fixer-keep-grouped-queued-prompts-atomic-thr_sshib6bv4r branch from efb6c8e to 39e09f6 Compare September 1, 2026 18:45
@ymichael
ymichael merged commit f09b41e into main Sep 1, 2026
24 of 25 checks passed
@ymichael
ymichael deleted the bb/fixer-keep-grouped-queued-prompts-atomic-thr_sshib6bv4r branch September 1, 2026 18:57
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.

1 participant