Repository navigation
Description
Summary
When a Pi extension starts a compaction on its own (ctx.compact(), for example after a run settles), a message sent to the thread during that compaction is not queued. bb sends it into the compaction turn as a steer, Pi rejects it, and the thread ends in error. The message is lost. I expected it to wait and be delivered once compaction finishes, the way it does during a bb /compact.
Versions and environment
- bb 0.47.1 (desktop app), and reproduced from source at
b6743a3withpnpm dev - macOS 27.0.1
- Pi 1.4.0, provider
pi
Steps to reproduce
- Add a Pi extension that calls
ctx.compact()onagent_settledand holdssession_before_compactfor a few seconds, so the compaction window is easy to hit. (I used one that only arms itself when a marker file exists, and returns a custom summary after 12 s.) - Start a Pi thread with a prompt large enough to be compactable (over Pi's
keepRecentTokens, ~20k tokens). - Arm the extension and send a follow-up. When that run settles, the extension starts compaction.
- While compaction is running, send another message:
bb thread tell <thr> "Reply only with: third".
Expected vs actual
Expected: the message is queued (waitingOn: thread-busy) and sent when compaction ends.
Actual: tell returns delivery: sent, mode: steer, then the thread records:
client/turn/rejected {"reason":"command_failed","message":"Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry."}
system/error {"code":"thread_command_failed","message":"Command turn.submit failed", ...}
provider/error {"message":"Provider error","detail":"Cannot submit a prompt while compaction is in progress..."}
turn/completed {"status":"failed"}
Compaction itself still completes 11 s later, but the compaction turn is marked failed and the message is never delivered.
Evidence
- Pi opens a bb turn for a manual
compaction_start(delta-translation.ts#L727), so the server sees an active turn and routes the send to steer. - The server only queues sends during compaction when the active turn's request was a bb
/compactcommand (thread-events.ts#L865-L889, used at dispatch-attempt.ts#L495). A compaction the provider started has no bb request, so it is not recognised. - Pi's
AgentSession.prompt()throws this error whenever a manual compaction is running (extensionctx.compact()or RPCcompact). It does not throw during auto-compaction.
What I ruled out
- Not pi
/compacton a small session surfaces as a failed turn and puts the thread in error state #1721: that was/compacton a small session failing; this is a message sent during a compaction bb did not start. - bb's own
/compactis already handled (queue since Queue system notices during manual compaction #6334 for system notices; user messages before that). - Still happens on
mainatb6743a3.
Suggested priority
Hits anyone running an auto-compacting Pi extension (we use one internally that compacts past a token threshold). The user's message is lost and the thread ends in error; the workaround is to resend after compaction.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 27, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotproviders,threads,provider-pi,confirmed-repro.Queue messages sent while Pi runs an extension-started compaction (#6420