Repository navigation
Conversation
While a thread waits only on approvals, the composer stays usable. Sending denies the approvals through the Deny path once the message is queued behind them, and the message reaches the agent when the denials resolve. Questions, plugin forms and approvals without deny still block. The server takes declinePendingApprovals on send, the CLI takes bb thread tell --decline-approvals. Fixes get-bb#6666
lanjak
marked this pull request as draft
November 21, 2026 04:39
2 tasks done
Contributor
Author
|
Closing this for now. The feature needs maintainer sign-off on #6666 first. The branch stays on my fork as a prototype, linked on the issue. |
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
While a thread waits on an approval, the composer hides its editor and blocks sending (
buildFollowUpSubmitModereturnsblocked: pending-interaction). To redirect the agent, the user has to click Deny, wait, and then type. The agent often raises the next approval before the user can send the redirect, as #6666 describes. Approval resolutions carry no text, so the typed message has to reach the agent after the denial.What changed
declinePendingApprovals: trueonPOST /threads/:id/send(SDKthreads.send) first checks the turn-bound interactions inpendingstatus. If one is a question, a plugin form, or an approval without adenydecision, it returns 409awaiting_user_interactionand declines nothing. Then it dispatches normally. Only when the existing dispatch logic queues the message withwaitingOn: interactiondoes it deny each approval throughresolvePendingInteraction, the same path the Deny button uses. The message is delivered when the denials resolve. A send that fails declines nothing. An approval answered between the check and the denial (409 conflict) is skipped, and the message stays queued. Any other deny error, such as a disconnected host, fails the request, so the caller does not see success while the approvals stay pending. A question that appears during dispatch is skipped; the message waits behind it. It returns 400 when combined withcompactFirst,sendAt,mode: "start",mode: "queue-if-active"or/clear. Without the flag nothing changes, so abb thread tellfrom another agent can never decline a user's approval by accident.classifyFollowUpPendingInteractions(client-core) returnsapprovalswhen every pending interaction is an approval that offersdeny, including plan approvals. Then the submit mode isqueuewithdeclinesPendingApprovals: true. The editor stays visible under the approval card, with the placeholder "Send a message to decline and redirect the agent" and the send title "Decline and send (Enter)". Enter sendssteer-if-activewith the flag, also with "steer on Enter" on. The modifier shortcut, scheduled sends and standalone/compactand/cleardo not decline. A pending question or plugin form still hides the editor, as before.bb thread tell --decline-approvals. The SDK passes the field throughsendJson, which the app uses too.bb guide thread-messaging. The contract allowlist entry for optional send fields now names the new field.There are no daemon wire changes.
How you verified
public-thread-decline-approvals.test.ts: two approvals are denied and the message is delivered asturn.submitonce they resolve. Without the flag, approvals stay pending. A pending question or an approval withoutdenygives 409 and nothing is declined or queued. A send that fails in dispatch (an unsupported permission mode) leaves the approval pending. An approval answered during the denial loop does not stop the others or the queued message. A deny that fails for another reason fails the send. The invalid combinations are rejected.deny, resolving), the submit mode, and the request, also for/compactand/clear.ThreadDetailPromptArea: the editor shows and the send carries the flag. A question keeps it blocked.FollowUpPromptBox: the editor shows while declining. Enter uses the normal send with "steer on Enter" on.tell --decline-approvals: this also covers the SDK mapping.denycheck, and the built-in command check. One check found that the SDK'ssendJsonwould have dropped the flag for the app.pnpm exec turbo run typecheck lint lint:type-aware testfor@bb/server-contract,@bb/server,@bb/client-core,@bb/app,@bb/cli,@bb/sdkand@bb/templates: all pass, except two local failures that also fail onmain(UpdatePluginDialogdate text andplugin-scaffold-externalnpm EALLOWSCRIPTS).LazyQueuedMessagesListtimed out once under the full parallel run and passes on its own.pnpm --filter @bb/qa standalone:start) with a real Claude Haiku thread in accept-edits mode, asked to runtouchoutside the sandbox:bb thread tell --decline-approvals "... Reply with REDIRECTED". The send was queued withwaitingOn: interaction. The approval went frompendingtoresolvedwithdeny. The command never ran, and the agent answered "REDIRECTED".steer-if-activewithdeclinePendingApprovals: true. The approval was denied, the file was not created, and the agent answered "UIREDIRECTED". This run also found that "steer on Enter" disabled the send while declining. That is fixed, and a test covers it.Fixes #6666