Repository navigation
Show Codex async questions as question cards - #5263
Merged
Merged
Conversation
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]>
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]>
3 tasks done
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
Outside plan mode Codex asks questions with
request_user_input_async. Codex emits anagentMessagewithdelivery: "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
plugins/provider-codex): the adapter records each async question as Codex extension state. The plugin server watches thread events and opens abb.ui.requestInputform rendered with the sharedQuestionForm, 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 withbb thread interactions respond. A cancelled question row no longer reads as answered. The plugin overview and thecodex-providerskill document the behavior and the CLI path.apps/server,packages/db): the one-active-interaction guards are gone. "Holds the turn" now checks for any open card that has a turn (newhasTurnBoundActivePendingInteractionForThread), not just the newest one. Change notifications readhasPendingInteractionfrom the database instead of reportingfalsewhenever one card settles. Ask User Question no longer tells the model that only one prompt can be open.ThreadPendingInteractionBannersrenders 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 (PendingInteractionShelltakesexpandedByDefault).No
HOST_DAEMON_PROTOCOL_VERSIONchange: async questions travel as Codex extension state over the existing extension event, andhasPendingInteractionis 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-questionafter rebasing onto current main: 20 of 21 tasks passed. The one failure wasPluginIcon.test.tsxreading a stale, ignoredplugins/navigation/build-output directory in this worktree. After deleting that directory the file passes (8/8).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 synchronousagentMessage),pending-interactions.test.ts(a provider approval keeps blocking alongside open plugin cards), andThreadPendingInteractionBanner.test.tsx(the next card expands once the cards above it are answered).Fixes #4990
🤖 Generated with Claude Code