Repository navigation
Conversation
ymichael
force-pushed
the
bb/class-fix-one-parent-notification-hook-for-inter-thr_vycwbdfhq2
branch
2 times, most recently
from
November 17, 2026 20:30
6fcec6e to
1da4ed9
Compare
Provider registration and plugin interaction creation now share one announcement step in PendingInteractionLifecycle: timeline event, interactions-changed, interaction.pending, and the parent needs-attention notice. The provider route no longer requests the notice itself, so plugin cards (AskUserQuestion on Codex, Pi, and ACP) reach the parent too. Fixes #7457 Co-Authored-By: Claude Opus 5.5 <[email protected]>
createInteraction is now the lifecycle's only caller of createPendingInteraction. It inserts the row (after the provider's lookup for an existing row, in the same transaction) and then announces it, so a new creation path cannot store an interaction without the timeline event, interaction.pending, or the parent notice. The plugin path registers its waiter after the announcement; plugin handlers, hub notifications and the parent notice are all deferred, so nothing can answer the card in between. A test fails if anything else in apps, packages or plugins src calls createPendingInteraction. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/class-fix-one-parent-notification-hook-for-inter-thr_vycwbdfhq2
branch
from
November 18, 2026 00:03
1da4ed9 to
c8a9078
Compare
A plugin card does not hold the child's turn, so the parent notice now reads "Pending plugin request: <title>" plus "Interaction: <id>" instead of "Blocked on plugin request:", which lets the parent answer it directly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/class-fix-one-parent-notification-hook-for-inter-thr_vycwbdfhq2
branch
November 18, 2026 04:19
This was referenced Nov 18, 2026
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
Creating an interaction has two entry points in
PendingInteractionLifecycle:registerPendingInteractionfor provider requests from the daemon, andrequestPluginInteractionfor plugin cards (bb.ui.requestInput, whichAskUserQuestionuses on Codex, Pi and ACP). Each path ran its own copy of the side effects that follow creation. The parent needs-attention notice was not in either copy. It lived in the HTTP route/internal/session/interactive-request, so only the provider path sent it. A child's plugin question therefore never reached its parent inautoorstuckmode (#7457). #3397 was the same split: the plugin copy was missinginteraction.pending.What changed
PendingInteractionLifecycle.createInteractionis now the only caller ofcreatePendingInteraction. In one transaction it inserts the row, after the provider's lookup for an existing row. It then callsannounceCreatedInteraction, which appends the timeline event, sendsinteractions-changed, emitsinteraction.pending, and requests the parent notice. BothregisterPendingInteractionandrequestPluginInteractiongo through it, so a new creation path can't store an interaction without those effects. A retried provider registration (outcome: "existing") returns before the announcement, so the parent is still notified once.setImmediate, the hub notification goes over the WebSocket, and the parent notice is deferred. The twosignal.abortedchecks between the insert and the announcement are gone; nothing asynchronous happens there, so they could never be true. On setup failure the row is still interrupted ("Plugin interaction setup failed") and the error rethrown.internal/interactive-requests.tstoservices/interactions/pending-interaction-parent-notice.ts. The code is unchanged, except that it reuses the thread row the lifecycle already loaded. The route now only registers the interaction.bb.ui.requestInputon a child thread now cause a parent notice.Patches this deletes or supersedes
requestChildThreadNeedsAttentionNotificationininteractive-requests.ts).registerPendingInteractionandrequestPluginInteraction, which is the per-path emit Emit pending events for committed plugin interactions #3398 had to patch.requestPluginInteractionand left two call sites. This PR leaves one and keeps Notify parents when plugin interactions are created #7458's notice wording.Issues and fixes from this root cause (separate per-path producers of creation side effects)
interaction.pending; #3398 added the emit to the plugin copyRemaining follow-up: #7457 point 6. When someone answers the child's question, the parent is not told that a decision was made. Resolution, expiry and dismissal notices are tracked in #3614 and are out of scope here.
Not in this class, and not changed here: turn-end notices (#3956/#4356, #6820/#6821), and parents never learning that a child was unblocked (#3614).
Decisions for review
bb.ui.requestInputon a child thread. The same filters apply as for provider requests:autoandstucknotify,offand fork children do not.Pending plugin request: <title>followed byInteraction: <id>(the wording from Notify parents when plugin interactions are created #7458), for examplePending plugin request: Which color?/Interaction: pint_…. The ID lets the parent answer withbb thread interactions answer. Provider requests keepBlocked on <kind>:, because they do block the turn.How you verified
apps/server/test/services/interaction-parent-notifications.test.tscovers 4 creation paths and 4 child kinds, 16 cases. The paths are a provider command approval, a provider user question and a provider plugin-defined request, all sent over the real HTTP route with a retried registration, plus a plugin card. The child kinds areauto,stuck,offand a fork child. Each case holds parent delivery and asserts that exactly oneinteraction.pendingwas emitted and that the parent has exactly the expected number (0 or 1) ofchild-needs-attentionnotices.autoandstuck(expected [] to have a length of 1 but got +0). That is A child thread's AskUserQuestion does not notify the parent thread (parent notifications miss non-blocking questions) #7457.emitPluginInteractionPendingremoved (the pre-Emit pending events for committed plugin interactions #3398 shape): all 4 plugin-card cases fail (expected [] to deeply equal [ 'pint_…' ]).pnpm start:worktreeinstance: a Codex parent and a Codex child (--parent-thread,auto), where the child callsAskUserQuestion.pending, and the parent gets onlychild-completed. Nochild-needs-attentionarrives.child-needs-attentionin the same second the card is created, thenchild-completed. With astuckchild, the parent gets only the notice:@thread:… needs help./Pending plugin request: Which color?/Interaction: pint_….interaction creation ownershiptest scans everyapps/*/src,packages/*/srcandplugins/*/srcfile outside tests. It fails ifcreatePendingInteractionis called anywhere except the lifecycle; the function's own definition is excluded. Adding a stray call ininternal/interactive-requests.tsmade it fail and name that file. Thepackages/db/scripts/query-costsseed scripts are dev tools that write fixture rows, so the check doesn't scan them.stuck/offfiltering and fork-child filtering are now covered for every path by the contract table, so they were removed. The route's message-content and retry test stays.pnpm exec turbo run test --filter=@bb/server -- test/services/interaction-parent-notifications.test.ts test/services/pending-interaction-blocker-summary.test.ts test/internal/internal-interactive-requests.test.ts test/services/pending-interactions.test.ts test/threads/system-notice-dispatch.test.ts test/services/plugins/plugin-thread-events.test.ts test/threads/thread-send-dispatch.test.ts test/internal/internal-tool-call-regressions.test.ts test/public/public-thread-interactions.test.ts test/services/plugins/plugin-background.test.ts: 10 files, 218 tests pass.pnpm exec turbo run typecheck --filter=@bb/serverpasses.oxfmtis clean on the changed files.Fixes #7457
🤖 Generated with Claude Code