← Reports

#7457 · Plugin interaction creation skips parent attention notifications

Bug Priority: Medium Effort: Medium threads ask-user-question

Issue #7457 · 2026-11-12 · base 030b1b729f28acedc6f86cd65a71cb3678da8124

Verdict: REPRODUCED · Root-cause confidence: high

1. TL;DR

A child can display a plugin-owned question and keep working without waking its idle parent. The server persists the question and emits the plugin pending event, but does not queue the existing child-needs-attention notice. Provider-owned approvals use a different registration path that does queue that notice. This is a missing call in plugin interaction creation, not a failure of the auto/stuck notification-mode filter. The regression fails in two separate clean checkouts at the trusted main commit, and passes after a server-only fix.

2. Claims vs findings

ClaimFindingEvidence
Pending child questions do not reach the parent.Verified at the server boundaryBoth auto and stuck cases create a pending question, but captured parent turn submission times out on main.
The child can keep working while its question is pending.VerifiedThe persisted plugin interaction has turnId null and hasTurnBoundPendingThreadInteraction returns false, with a started child turn.
The problem is caused simply by a turn not being blocked.RefinedThe direct cause is two registration entry points: the provider route explicitly requests the parent notice, while requestPluginInteraction never does.
The historical ACP/GLM child and Claude parent missed a question for ten minutes.Unverified historical detailsNo real provider sessions or production data were used. The current shared server path reproduces the missing delivery immediately.
Parents should learn about submitted answers too.Separate scopeThis reproduction targets initial pending delivery; answer/resolution lifecycle notification is already tracked in #3614 and is not claimed fixed here.

3. Environment

4. Minimal reproduction

  1. Prepare a clean trusted checkout and add the supplied, repository-derived regression test:
    git clone https://github.com/get-bb/bb.git bb-7457-first
    cd bb-7457-first
    git checkout 030b1b729f28acedc6f86cd65a71cb3678da8124
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
    pnpm exec turbo run build
    curl -fsSL https://get-bb.github.io/reports/issues/7457/repro/interaction-parent-notifications.test.ts -o apps/server/test/services/interaction-parent-notifications.test.ts
    pnpm exec turbo run test --filter=@bb/server -- test/services/interaction-parent-notifications.test.ts
  2. The test creates an idle parent with previous runtime state, an active child with a started turn, and a server-owned plugin question. It verifies that the card is pending and not turn-bound, then waits for a parent turn submission.
  3. Expected: both auto and stuck cases receive a parent notice naming the child and question while the question remains pending.
  4. Actual on unchanged production code:
    Error: Timed out waiting for queued command; captured: none
    Test Files  1 failed (1)
         Tests  2 failed (2)

Download the complete regression test. It invokes the real server lifecycle used by plugins, not a handwritten replacement of notification behavior.

Complete reproduction test
import { describe, expect, it } from "vitest";
import {
  seedEnvironment,
  seedHostSession,
  seedProjectWithSource,
  seedThread,
  seedThreadRuntimeState,
  seedTurnStarted,
} from "../helpers/seed.js";
import { waitForQueuedCommand } from "../helpers/commands.js";
import { withTestHarness } from "../helpers/test-app.js";

describe("plugin interaction parent notifications", () => {
  it.each(["auto", "stuck"] as const)(
    "notifies a parent in %s mode while the child keeps running",
    async (parentNotifications) => {
      await withTestHarness(async (harness) => {
        const { host } = seedHostSession(harness.deps, {
          id: `host-plugin-question-${parentNotifications}`,
        });
        const { project } = seedProjectWithSource(harness.deps, {
          hostId: host.id,
        });
        const environment = seedEnvironment(harness.deps, {
          hostId: host.id,
          projectId: project.id,
        });
        const parent = seedThread(harness.deps, {
          environmentId: environment.id,
          projectId: project.id,
        });
        seedThreadRuntimeState(harness.deps, {
          environmentId: environment.id,
          providerThreadId: "provider-parent",
          threadId: parent.id,
        });
        const child = seedThread(harness.deps, {
          environmentId: environment.id,
          parentThreadId: parent.id,
          parentNotifications,
          projectId: project.id,
          status: "active",
        });
        seedTurnStarted(harness.deps, {
          providerThreadId: "provider-child",
          threadId: child.id,
          turnId: "turn-child-question",
        });
        const controller = new AbortController();
        const pending =
          harness.deps.pendingInteractions.requestPluginInteraction({
            pluginId: "ask-user-question",
            threadId: child.id,
            rendererId: "ask-user-question",
            title: "Choose storage",
            payload: {
              questions: [
                {
                  id: "storage",
                  prompt: "Which storage should the worker use?",
                  shortLabel: "Choose storage",
                  multiSelect: false,
                  allowFreeText: true,
                  options: [
                    { value: "sqlite", label: "SQLite" },
                    { value: "files", label: "Files" },
                  ],
                },
              ],
            },
            presentation: {
              label: { pending: "Asking a question", completed: "Asked" },
              icon: { glyph: "MessageQuestion" },
            },
            describeSubmission: null,
            timeoutMs: 10_000,
            owner: { pluginId: "ask-user-question" },
            signal: controller.signal,
          });
        try {
          expect(
            harness.deps.pendingInteractions.listPendingThreadInteractions(
              child.id,
            ),
          ).toMatchObject([
            { origin: { kind: "plugin" }, status: "pending", turnId: null },
          ]);
          expect(
            harness.deps.pendingInteractions.hasTurnBoundPendingThreadInteraction(
              child.id,
            ),
          ).toBe(false);
          const notification = await waitForQueuedCommand(
            harness,
            ({ command }) =>
              command.type === "turn.submit" && command.threadId === parent.id,
          );
          expect(notification.command).toMatchObject({
            type: "turn.submit",
            input: expect.arrayContaining([
              expect.objectContaining({
                type: "text",
                text: expect.stringContaining(`@thread:${child.id}`),
              }),
            ]),
          });
          expect(JSON.stringify(notification.command)).toContain(
            "Choose storage",
          );
          expect(
            harness.deps.pendingInteractions.listPendingThreadInteractions(
              child.id,
            ),
          ).toMatchObject([{ status: "pending" }]);
        } finally {
          controller.abort();
          await pending;
        }
      });
    },
  );
});

5. Root cause

The built-in question tool requests server UI input. The plugin runtime forwards interaction requests to requestPluginInteraction.

Plugin creation writes the timeline and emits interaction.pending, but has no parent attention dispatch:

    try {
      appendPendingInteractionTimelineEvent(this.deps, interaction);
      notifyInteractionChanged({
        deps: this.deps,
        threadId: interaction.threadId,
      });
      emitPluginInteractionPending(thread, interaction);
    } catch (error) {

The provider registration route explicitly performs the missing action:

      if (registered.outcome === "created") {
        requestChildThreadNeedsAttentionNotification(deps, {
          blockerSummary: buildChildThreadBlockerSummary(
            registered.interaction,
          ),
          childThreadId: registered.interaction.threadId,
        });
      }

The existing parent policy already allows needs-attention under auto and stuck, suppresses off, and excludes fork/plugin-origin children. Thus no new notification mode, protocol, persisted field or provider transport behavior is needed.

6. Proposed fix and local validation

Move the existing parent attention request helper into the existing child-thread notification service. Keep the provider registration caller and call the same helper once after a plugin interaction is announced. Supply the request title and interaction ID; preserve non-blocking semantics and the existing parent-policy checks. The fix does not forward submitted answers or introduce a new resolution event.

The two regression cases pass with this fix. The relevant lifecycle, provider registration, summary formatting, child notification and parent-policy suites pass: 6 files, 81 tests. Server lint and typecheck pass. No public schema, protocol, dependency, stored data or UI change is required.

7. Verification

The same investigator repeated the corrected regression in two clean temporary worktrees named baseline and verify, both detached at the exact recorded commit. Each was separately installed and fully built; each test run allocated fresh harness storage. Production files remained unchanged. No ports needed changing because these tests do not listen on network ports.

Command in each checkout: pnpm exec turbo run test --filter=@bb/server -- test/services/interaction-parent-notifications.test.ts. Both returned exit 1, with two failures caused by the missing parent submission. These are repeated checks by the same agent, not independent verification.

Investigation correction: an initial test fixture used an invalid thread-status spelling caught by typecheck. It was corrected to the domain value active, then both clean-baseline reproductions and the fixed suites were rerun. The final published artifact contains only the corrected test.

8. Related issues and PR check

9. Appendix

Issue text and comments were treated as untrusted claims. No issue-supplied command, patch, branch, script, external link or instruction was executed. The reproduction and fix were derived from trusted main source. Only isolated test data was used. Browser and real-provider user journeys were not run.

Validation commands:

pnpm exec turbo run test --filter=@bb/server -- test/services/interaction-parent-notifications.test.ts test/services/pending-interactions.test.ts test/internal/internal-interactive-requests.test.ts test/internal/interactive-request-blocker-summary.test.ts test/services/threads/child-thread-notifications.test.ts test/threads/thread-parent.test.ts
pnpm exec turbo run lint typecheck --filter=@bb/server
git diff --check

repro-first-corrected.log — sanitized output; local temporary paths are replaced.

repro-second-corrected.log — sanitized output; local temporary paths are replaced.

fix-tests-final.log — sanitized output; local temporary paths are replaced.

fix-checks-final.log — sanitized output; local temporary paths are replaced.