Skip to content

Queued messages dropped under rapid back-to-back sends: ThreadLifecycleEventNotAppliedError (no transition for run.started from status active) #3716

Closed
treesitter1/bb
#1

Description

@rekon307

What happens

When messages are sent to a thread in rapid succession (back-to-back threads.send calls with no settle wait between them), the server intermittently rejects a send with:

ThreadLifecycleEventNotAppliedError: no transition for run.started from status active

and the rejected message is dropped before delivery — it never reaches the agent and is not retained in the queue.

Reproduction (bb 0.43.1, desktop, macOS)

  1. Have a thread whose previous turn has completed (run status active).
  2. Send N messages back-to-back to that thread through threads.send (we drive this from a plugin RPC; a batch of ~50 sends reproduces it reliably).
  3. Observed: roughly 2 of 3 unprotected batched runs die mid-sequence with the error above; in our logs the error appears 400+ times lifetime. Sending with mode queue does not avoid it.
  4. The failing send is dropped pre-delivery. Subsequent sends continue.

Expected

A queued/rapid message should never be silently dropped. Either run.started from status active should be a legal transition, or the dispatch should wait for the run state instead of rejecting and discarding.

Workaround we currently ship

After a rejected send: settle-wait, then resend the same prompt (capped retries). With retry, batches complete 6/6 in our tests. Risk note: if a rejection can ever occur AFTER delivery, a resend would duplicate a turn — we found no such case; every observed failure was pre-delivery dispatch, but we cannot prove the invariant from outside.

Happy to provide more logs or a minimal script if useful.

Activity

  1. added theissue type on Sep 15, 2026
  2. added
    threads
    confirmed-repro
    on Sep 15, 2026
  3. bb-slop-cop commented on Sep 15, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Bug · High priority · Medium effort; labels: threads, confirmed-repro.

    REPRODUCED · high confidence. Concurrent sends pass idle admission together; competing start transactions then roll back without retaining the input. The regression reproduced this in two clean-base checkouts: four sends, one command, three lifecycle errors, zero queued messages.

    Reproduction and root-cause report · Fix PR #3718

    The fix rechecks status inside the append transaction and reattempts dispatch. All 44 relevant tests and server typecheck pass; 73 changed lines across two files. PR is ready for review and has not been merged.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reprothreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions