Skip to content

Show Codex async questions as question cards - #5263

Merged
ymichael merged 4 commits into
mainfrom
bb/fix-bb-issue-4990-thr_p4pqcnq73y
Oct 9, 2026
Merged

ymichael merged 4 commits into
mainfrom
bb/fix-bb-issue-4990-thr_p4pqcnq73y

Conversation

@ymichael

@ymichael ymichael commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

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 Enhancement: open approval requests by default #4915 (approvals open by default): Enhancement: open approval requests 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 Enhancement: open approval requests by default #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

qa and others added 4 commits October 9, 2026 10:20
Codex request_user_input_async emits an agentMessage carrying
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 be answered.

Handle it inside the Codex plugin with the mechanisms the Ask User
Question plugin uses. The adapter records each async question as Codex
extension state. The plugin server watches thread events, opens a
bb.ui.requestInput form rendered with the shared QuestionForm, and sends
the submitted answer to the thread as a message, steering an active turn
or starting a new one. The card survives the turn ending, can be
dismissed, expires after an hour, and is answerable with
bb thread interactions respond.

Fixes #4990

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An open Codex async question card made the server reject every
provider approval or question on that thread ("already awaiting user
interaction"), so Codex's escalated commands failed while the card was
open, for up to an hour.

Remove the one-active-interaction guards. "Holds the turn" now checks
for any open card with a turn rather than only the newest, and change
notifications read hasPendingInteraction from the database instead of
reporting false whenever one card settles. The app renders every open
card oldest first; the oldest keeps its usual default and the rest
start collapsed. Codex async questions open immediately, and Ask User
Question no longer tells the model only one prompt can be open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only the oldest open card starts expanded. A card that became the
oldest after the cards above it were answered stayed collapsed,
because the shell read its default only on mount. Expand it when its
default switches to expanded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit c3b4993 into main Oct 9, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex **async** choice questions show as plain text instead of a question card

1 participant