Repository navigation
Send messages queued after a manual stop instead of holding them - #6255
Merged
Merged
Conversation
A message queued while a thread was stopping carried a `stopping` wait and ran once the stop landed. One queued a moment later, after the thread was already idle, got `thread-busy` instead, so the manual-stop pause held it indefinitely even though the user composed it after the stop. Rows created while the manual-stop pause is in force now carry `stopping` too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The thread composer and the embedded chat chose between two endpoints from their cached runtime status: the explicit queued-messages create when the thread looked busy, the send endpoint otherwise. A stale status sent a message for an idle thread down the queue path, where it could sit behind the manual-stop pause. Both composers now always submit through send with queue-if-active, which decides from the server's own state. The send path already inserted an optimistic queued row and reconciled it either way. Its prediction now uses the composer's busy predicate, so a thread that is starting, provisioning, stopping or waiting for its host still shows the queued row immediately. The embedded chat only toasts about a queued delivery the composer did not expect. The now-unused create-queued mutation, its cache transactions and the client-core request builder are removed. The side-chat plugin and `bb thread queue create` keep the explicit endpoint. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…them Send to main thread used the queued-messages endpoint, which always adds a row behind the queue, so a reply sent to an idle or manually stopped main thread could sit there instead of being delivered. It now uses threads.send with queue-if-active, the same path the composer uses, so the server decides whether the reply runs now or waits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mistakeknot
added a commit
to mistakeknot/aleph
that referenced
this pull request
Oct 27, 2026
…ed thread The pause check added with get-bb#6255 read the requested thread's id. When a retired thread redirects to its successor, the message lands on the successor, so the check must read the successor's id; otherwise a message queued after the successor was manually stopped got thread-busy and the automatic drain held it. Upstream has no retired redirect, so this mismatch came from adapting the pick to the fork. Adds a regression test for a manually stopped successor. Bead mk-ooomf.8. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mistakeknot
added a commit
to mistakeknot/aleph
that referenced
this pull request
Oct 27, 2026
Backport five upstream bb fixes (get-bb#6247, get-bb#6255, get-bb#6243, get-bb#6334, get-bb#6358)
2 of 13 tasks
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.
Human comments
What was wrong
buildFrpcConfig(packages/frp-client/src/config.ts) never settransport.poolCount, so it defaulted to 0 and frps kept no idle work connections for bb connect next. In frp v0.71.0 (the version pinned inpackages/tunnel-contract/src/next.ts),server/control.goGetWorkConnhandles an empty pool by sendingReqWorkConnand waiting for frpc to dial a connection, which costs an extra round trip. After every take it sends anotherReqWorkConnto replenish. frps's vhost HTTP proxy keeps onlyMaxIdleConnsPerHost: 5, so a burst of more than 5 parallel requests needs new work connections. One example is the web app refetching every active query when a tab resumes. Each of those requests waits a round trip, and the replenish requests then overflow thepoolCount + 10work-conn channel.RegisterWorkConnrejects the extra connections, and frpc logs this asStartWorkConn contains error: work connection pool is full, discarding. The user's server log showed 16–21 of these per burst on 2026-10-23.What changed
buildFrpcConfignow setstransport.poolCount: 10. That is the gate'smaxPoolCount(apps/connect-next/src/frps.ts), so frps uses the full value instead of clamping it. frps now pre-requests 10 work connections at login and keeps the pool full, and the channel capacity grows to 20, which covers the bursts we observed. frp multiplexes work connections as streams over the existing control connection by default, so idle pooled connections are cheap.infolevel (packages/frp-client/src/supervisor.tsonLine). Fewer of these lines should appear now, and lowering the level for one benign message doesn't seem worth a special case.How you verified
pnpm exec turbo run test typecheck --filter=@bb/frp-client --filter=./plugins/connect-next: all passing (frp-client 40 tests; connect-next 28 tests, includingfrp-e2e.test.ts, which launches the real frps/frpc binaries with the generated config and tunnels requests through it).packages/frp-client/test/config.test.ts.🤖 Generated with Claude Code