Repository navigation
Description
Summary
Multiple distinct queued inputs to a thread are coalesced into a single turn. Each input is individually accepted — client/turn/requested → turn/input/accepted with matching clientRequestId — but several accepted inputs share one turnId, so the agent sees them as one batch and may answer with one reply.
On an authority seat this is a dropped-wake risk: an instruction can be delivered, accepted, absorbed into a batch, and receive no individual response, with the event record showing successful delivery throughout.
Measurement
Joined via R = client/turn/requested, A = turn/input/accepted where A.data.clientRequestId == R.data.requestId, T = A.scope.turnId:
| seat | requests | multi-input turns | note |
|---|---|---|---|
| seat A (retired) | 478 | 154 | 95 turns ended in a single terse dismissal (19.9%) |
| seat B (current) | 482 | 28 | 0 dismissals; every multi-input turn still received exactly one agent reply |
Coalescing is present on both seats. The terse-dismissal pattern was specific to one seat's behaviour and is not reproducing on the current one — but 28 multi-input turns still resolve to one reply each, so the structural risk is independent of how any particular agent responds.
Where it appears to live
Reading the current source, the seam looks like BB core rather than a plugin concern:
- native active-turn routing and queue handling —
apps/server/src/routes/threads/actions.ts(~L315-338) andapps/server/src/services/threads/thread-send.ts(~L174-215) - queued-message grouping —
apps/server/src/services/threads/queued-messages.ts(~L437-478) andpackages/db/src/data/queued-thread-messages.ts(~L184-224) - request-to-turn projection —
packages/thread-view/src/accepted-client-request-context.ts(~L61-105)
A plugin can only choose a send mode and wait before sending; it has no influence over how accepted requests are grouped into turns.
Why event durability does not cover this
The native events prove delivery, not consumption. A request is accepted and recorded, and the record looks identical whether the agent addressed that input or folded it into a batch reply that never mentions it. So the usual "the durable record is authoritative" reasoning does not close the gap here.
Possible directions
- Surface the input count on a turn, so a consumer can see that N inputs produced one turn.
- Preserve per-input identity through to the turn so a reply can be correlated to a specific input.
- Make coalescing opt-in per thread, or expose it as a setting for seats where batching is unwanted.
No strong preference — (1) is the smallest and would let callers detect the condition without changing routing behaviour.
Reproduction
Send several bb thread tell messages to a thread in quick succession while it is mid-turn, then join client/turn/requested.requestId → turn/input/accepted.clientRequestId → scope.turnId in the thread log. Multiple requests will share one turnId.
Activity