Skip to content

Give plugin question forms core's host, and make Cancel end the request everywhere with a Back control in the child threads card - #8071

Merged
ymichael merged 4 commits into
mainfrom
bb/question-forms-give-plugin-forms-core-s-host-and-thr_9b7yp6zqn2
Nov 24, 2026
Merged

ymichael merged 4 commits into
mainfrom
bb/question-forms-give-plugin-forms-core-s-host-and-thr_9b7yp6zqn2

Conversation

@ymichael

@ymichael ymichael commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

In a parent thread's Active child threads card, Cancel meant two different things:

  • bb's own question form (for example Claude Code's AskUserQuestion): Cancel only closed the card, and the child kept waiting.
  • A plugin form (Secrets, Pi dialogs, Codex MCP elicitation, community forms): Cancel ended the request, or stopped the child's turn for a provider's question.

bb's form behaved differently because it could tell it was in the card. A private runtime slot (__bbPluginRuntime.questionFormHost) gave it density, promptShownAbove and closeInline. Plugins only got the public ExperimentalQuestionFormHost, which lacked those fields; the registry's flavor hardcoded them to defaults.

The card's "close" meaning came from #5422/#5423. With a single child the card had no Back control, so Cancel doubled as Back.

This closes audit a-thread F2 and the blocker named for core-contributions rank 15.

What changed

One Cancel, one meaning. Cancel on a pending interaction form ends the request wherever the form renders: it cancels a plugin request, or stops the turn for a provider request.

  • usePendingInteractionCancel is the only implementation. Core's UserQuestionAnswerForm uses it, and so does the cancel prop that PluginPendingInteractionComposer passes to plugin forms.
  • The shared QuestionForm no longer turns Cancel into "close the card".
  • For plugin forms this is main's behaviour. For bb's own question in the card, Cancel now stops the child's turn instead of closing the card.

The card owns Back.

  • ThreadPromptContextBanner shows the ‹ Active child threads back header whenever a question is open, including with a single child.
  • Escape still returns to the list. Both leave the question waiting.

Public API (@get-bb/plugin-sdk 0.6.196):

  • ExperimentalQuestionFormHost gains density: "default" | "compact" and promptShownAbove: string | null. These are the layout fields core's host already had.
  • closeInline stays private and is removed from the inline context, because no form needs to close the card.
  • PluginPendingInteractionProps.submit() and cancel() get JSDoc. cancel is documented as placement-independent.

Core and plugins read the host the same way:

  • shared-ui's QuestionForm (also the registry item) reads the host through experimental_useQuestionFormHost.
  • vite-core-plugin-sdk-app.ts binds shared-ui's @get-bb/plugin-sdk/app imports to src/lib/shared-ui-plugin-sdk-app.ts.
  • core-plugin-sdk-app.test.ts checks that binding's members are the plugin runtime's own.
  • The host context moves from shared-ui into the app (question-form-host-context.ts).

Removed:

  • The private shim: the questionFormHost runtime slot, SHARED_UI_QUESTION_FORM_HOST_SPECIFIER, the build rewrite and the export-manifest entry.
  • The registry's question-form-host flavor and its pluginFlavors entry.
  • The provider-codex and provider-pi tsconfig paths to that flavor.

Docs:

  • docs/api_to_audit.md: core callers, consumers, and a new audit item on the two inline fields.
  • The Plugin Guide symbol ExperimentalQuestionFormHost.
  • bb-plugin-authoring references: frontend-hooks-and-ui.md and backend-cli-agents.md.
  • docs/forkable-plugins.md.

Community callers: brsbl's content-calendar and thread-organizer, and koenvg's pi-subagents, keep main's Cancel behaviour. pi-subagents can now read density and promptShownAbove from the public type.

How you verified

Tests. Each fails on the previous behaviour and passes on the branch.

  • PluginPendingInteractionComposer.test.tsx: a four-row table (plugin or provider origin, in the card or in the thread's own composer). cancel() cancels the request or stops the turn in every row, and the form reads density and promptShownAbove from experimental_useQuestionFormHost().
  • ThreadPromptContextBanner.child-questions.test.tsx:
    • Back from a single child's question returns to the list without stopping the child.
    • Cancel in the card stops the child's turn.
  • core-plugin-sdk-app.test.ts also covers the shared-ui binding.

Live, on pnpm start:worktree, main f1b65545c3a vs this branch, driven with the dev bb CLI. Fixtures: a Claude Code child asking with AskUserQuestion, and bb secret request run against a child thread.

Check main Branch
Cancel on bb's own question in the card Card closed; question still pending, child active Child idle, nothing pending: turn stopped
‹ Back with a single child No Back control Back to the list; question still pending
Cancel on the Secrets form in the card Secret request cancelled (user). Secret request cancelled (user).
Served plugin bundles — Reference only experimental_useQuestionFormHost, not the questionFormHost slot

Commands (after rebasing on af25b0b5a60, SDK 0.6.196):

  • pnpm exec turbo run typecheck lint test for @bb/app, @bb/shared-ui, @get-bb/plugin-sdk, @bb/plugin-registry, @bb/plugin-build, provider-codex, provider-pi, ask-user-question, secrets, bb-guide and plugin-api-docs: 38/38 tasks; app 7471 tests in 706 files.

AGENT GENERATED

🤖 Generated with Claude Code

@ymichael
ymichael force-pushed the bb/question-forms-give-plugin-forms-core-s-host-and-thr_9b7yp6zqn2 branch 2 times, most recently from f7ee5a4 to 3a34869 Compare November 24, 2026 06:02
@ymichael ymichael changed the title Give plugin question forms core's host, and make Cancel in the Active child threads card only close it Give plugin question forms core's host, and make Cancel end the request everywhere with a Back control in the child threads card Nov 24, 2026
ymichael and others added 4 commits November 24, 2026 11:47
Plugin pending-interaction forms now get the same question-form host as
bb's own forms, through the public experimental_useQuestionFormHost:
ExperimentalQuestionFormHost gains density, promptShownAbove and
closeInline. Core's shared QuestionForm reads the host through that hook
(the app binds shared-ui's SDK imports to the runtime's own members), and
the private runtime slot that bundled plugins used, plus the registry
flavor that hardcoded the inline fields, are gone.

Cancel for core and plugin forms now runs one implementation. In a parent
thread's Active child threads card it only closes the card, as core's
form always did; a plugin form's cancel there used to stop the child's
turn or cancel its request. PluginPendingInteractionProps.cancel and
submit are documented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d its own Back

Cancel on a pending interaction form now means one thing wherever the form
renders: it cancels a plugin request or stops the turn of a provider request.
The Active child threads card leaves a question without answering through its
Back control, now shown for a single child too, and Escape.

closeInline leaves the public ExperimentalQuestionFormHost and the inline
context, since no form needs to know how to close the card. Codex's MCP form
labels its fallback Stop turn in both places again, and the Secrets overview
drops the card-only Cancel note.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael force-pushed the bb/question-forms-give-plugin-forms-core-s-host-and-thr_9b7yp6zqn2 branch from 4b9679b to 50a0a27 Compare November 24, 2026 19:52
@ymichael
ymichael merged commit 40b8939 into main Nov 24, 2026
96 of 98 checks passed
@ymichael
ymichael deleted the bb/question-forms-give-plugin-forms-core-s-host-and-thr_9b7yp6zqn2 branch November 24, 2026 20:09
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.

1 participant