Repository navigation
Enhancement: open approval requests by default - #4915
Merged
Merged
Conversation
An approval arrived as a single collapsed row that only said "Approval needed". The row has no decision buttons, so every request cost an extra click before you could even read what was being asked, let alone allow or deny it. Approvals now arrive open, showing the command together with the decision buttons, the same way questions already do. The card can still be collapsed by hand to read the conversation behind it, and the next request opens again. Plan reviews are left as they were and still arrive collapsed.
Every pending interaction card now opens on arrival, so the shell no longer needs a per-caller default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
expand-approvals-by-default
branch
from
October 8, 2026 04:02
e245542 to
1de09c7
Compare
ymichael
added a commit
that referenced
this pull request
Oct 9, 2026
## Human comments ## What was wrong Outside plan mode Codex asks questions with `request_user_input_async`. Codex emits an `agentMessage` with `delivery: "async"` and structured questions, then tells the model the question was accepted. The Codex adapter kept only the message text, so the thread showed plain bullets and nothing could answer the question. Even with a card in place, the server allowed only one open interaction per thread. While an async question card was open, every provider approval or question on that thread was rejected with "already awaiting user interaction". Codex's escalated commands failed for up to an hour. ## What changed - **Codex async questions** (`plugins/provider-codex`): the adapter records each async question as Codex extension state. The plugin server watches thread events and opens a `bb.ui.requestInput` form rendered with the shared `QuestionForm`, the same mechanism Ask User Question uses. Submitting sends the answer to the thread as a message, which steers an active turn or starts a new one. The card stays open after the turn ends, can be dismissed (which sends nothing), expires after an hour, and can be answered with `bb thread interactions respond`. A cancelled question row no longer reads as answered. The plugin overview and the `codex-provider` skill document the behavior and the CLI path. - **Several open interaction cards per thread** (`apps/server`, `packages/db`): the one-active-interaction guards are gone. "Holds the turn" now checks for any open card that has a turn (new `hasTurnBoundActivePendingInteractionForThread`), not just the newest one. Change notifications read `hasPendingInteraction` from the database instead of reporting `false` whenever one card settles. Ask User Question no longer tells the model that only one prompt can be open. - **App**: `ThreadPendingInteractionBanners` renders every open card oldest first. The oldest starts expanded and the rest start collapsed. When the cards above a collapsed card settle, it becomes the oldest and expands (`PendingInteractionShell` takes `expandedByDefault`). - **Rebase onto #4915 (approvals open by default)**: #4915 removed the shell's expand prop so every card always opens. This branch needs the prop back to collapse every card except the oldest. I resolved this by applying one rule to every kind: the oldest card opens, approvals included, and later cards start collapsed. With one pending card, the behavior is identical to #4915. No `HOST_DAEMON_PROTOCOL_VERSION` change: async questions travel as Codex extension state over the existing extension event, and `hasPendingInteraction` is a field that already exists on the server-to-app notification. ## How you verified - `pnpm exec turbo run typecheck lint test --filter=@bb/app --filter=@bb/server --filter=@bb/db --filter=bb-plugin-provider-codex --filter=bb-plugin-ask-user-question` after rebasing onto current main: 20 of 21 tasks passed. The one failure was `PluginIcon.test.tsx` reading a stale, ignored `plugins/navigation/` build-output directory in this worktree. After deleting that directory the file passes (8/8). - New tests: `async-questions.test.ts` (asks once and sends the answer as a message; opens every question without waiting for earlier answers; dismissal sends nothing; ignores other providers), `delta-translation.test.ts` (async question recorded as Codex extension state; none for a synchronous `agentMessage`), `pending-interactions.test.ts` (a provider approval keeps blocking alongside open plugin cards), and `ThreadPendingInteractionBanner.test.tsx` (the next card expands once the cards above it are answered). Fixes #4990 > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: qa <qa@x> Co-authored-by: Claude Opus 5.5 <[email protected]>
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
Small change, I think it's definitely a mistake that you need to expand first before you can take an action.
What was wrong
A pending approval (command, file edit, or tool use) arrived above the composer as a collapsed row that only said "Approval needed". That row has no decision buttons, so every approval cost a click before you could read what was being asked or answer it. Questions, plugin forms, and plan reviews (since #4929) already arrived open, so approvals were the only request card that started collapsed.
#3094 introduced the collapsed strip with every decision button on it, so it was fully actionable. #3147 moved the decisions into the expanded card to keep the compact row on a single line on mobile, which turned the collapsed default into an extra step with nothing to do on it.
What changed
PendingInteractionShelldrops itsinitiallyExpandedprop and always starts open. A request card is only collapsed when you collapse it, and new request types cannot come back collapsed by default.No wire, CLI, or SDK changes.
How you verified
ThreadPendingInteractionBanner.test.tsx: the approval tests now start from the open card. They cover the open default, deciding without expanding first, collapsing to the label-only row and reopening, Esc, and a new request arriving open after the previous one was collapsed. Against main's banner, 7 of these 16 tests fail.pnpm exec turbo run typecheck lint test --filter=@bb/app: clean (5639 tests).pnpm start:worktreewith a real Claude Code approval (curloutside the sandbox): the card arrives open with the command and decisions on desktop and mobile.🤖 Generated with Claude Code