Reports

#5475 · Mention candidate freshness and coverage

BugMedium priorityMedium effortuiGitHub issue

2026-10-14 · trusted origin/main a7d5dfcc8c27df1fea42847526ee62a338fe8052

Verdict: REPRODUCED · Root-cause confidence: high

1. TL;DR

The mention hook omits matching threads after the first 200 sidebar candidates, keeps server-side title and project changes invisible when no realtime update reaches its cache, and returns files for the previous query while a new query is pending. Five newly authored regression cases fail on unchanged trusted main in two clean checkouts. The existing two composer-hook cases pass in both runs. The path problem persists beyond the debounce into the replacement HTTP request because query placeholder data retains earlier results.

2. Claims vs findings

ClaimFindingEvidence
Exact-title search misses later threadsVerified215 cached active threads; exact title for thread 214 produces no matching thread on main.
Rename remains invisible without a realtime eventVerified, conditionalAfter the initial title is found, only the synthetic server changes; closing and reopening finds no new title. This simulates an absent event; it does not prove that a real websocket event was lost.
New projects remain absentVerified, conditionalThe synthetic server gains a project without a cache patch; reopening cannot find its name.
Earlier file rows survive new inputVerifiedSeparate cases reproduce during debounce and during a deliberately pending replacement request, while a correct current-query thread row is present.
Loading hides partial source workVerified by source inspectionThe hook computes loading only when its combined suggestions are empty; this reproduction does not require changing that policy.
Group ordering and alias semantics are additional defectsNot establishedNeither is needed to explain the reproduced results; no product judgment about ranking or aliases is made.
Specific macOS session behaviorNot directly evaluatedVerification uses Linux hook integration, not the reporter's machine, screenshots, or runtime data.

3. Environment

4. Minimal reproduction

  1. Clone and build the recorded trusted commit.
  2. Save the complete new test below at the indicated repository path.
  3. Run the three hook files, then repeat in a second clean worktree at the same commit.
git clone https://github.com/get-bb/bb.git bb-5475
cd bb-5475
git fetch origin main
git checkout --detach a7d5dfcc8c27df1fea42847526ee62a338fe8052
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build
# Save the linked reproduction artifact at apps/app/src/hooks/usePromptMentions.coverage.test.tsx
pnpm exec turbo run test --filter=@bb/app -- src/hooks/usePromptMentions.coverage.test.tsx src/hooks/usePromptMentions.test.tsx src/hooks/usePromptMentions.thread-context.test.tsx
git worktree add --detach ../bb-5475-second a7d5dfcc8c27df1fea42847526ee62a338fe8052
cd ../bb-5475-second
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build
# Save the same artifact at apps/app/src/hooks/usePromptMentions.coverage.test.tsx
pnpm exec turbo run test --filter=@bb/app -- src/hooks/usePromptMentions.coverage.test.tsx src/hooks/usePromptMentions.test.tsx src/hooks/usePromptMentions.thread-context.test.tsx

Expected: all seven cases pass, including the five regression cases. Actual output in both unchanged checkouts:

Test Files  1 failed | 2 passed (3)
     Tests  5 failed | 2 passed (7)

The three missing-resource assertions receive an empty array. Both path assertions receive the prior file instead of no paths:

AssertionError: expected [ { kind: 'path', …(5) } ] to deeply equal []
+ [ { "entryKind": "file", "kind": "path", "name": "cedar.md",
+     "path": "notes/cedar.md", "replacement": "notes/cedar.md",
+     "source": "workspace" } ]

Full outputs appear in the appendix: first run, second run. Temporary checkout prefixes and trailing whitespace are normalized. The compact path display above is condensed; use the inline output for the exact assertion diff.

Complete new test
// @vitest-environment jsdom

import { act, cleanup, renderHook, waitFor } from "@testing-library/react";
import { afterEach, expect, it, vi } from "vitest";
import type { SidebarBootstrapResponse } from "@bb/server-contract";
import { makeThreadListEntry } from "@bb/test-helpers/domain-fixtures";
import { createQueryClientTestHarness } from "@/test/queryClientTestHarness";
import {
  makeProjectWithThreadsResponse,
  makeSidebarBootstrapResponse,
} from "@/test/fixtures/projects";
import { makeSystemConfig } from "@/test/fixtures/system-config";
import { sdk } from "@/lib/sdk";
import { resetSidebarBootstrapCacheForTest } from "@/lib/sidebar-bootstrap-cache";
import { sidebarNavigationQueryKey } from "./queries/query-keys";
import { usePromptMentions } from "./usePromptMentions";

const queryClients: ReturnType<
  typeof createQueryClientTestHarness
>["queryClient"][] = [];

afterEach(() => {
  cleanup();
  for (const queryClient of queryClients.splice(0)) queryClient.clear();
  vi.unstubAllGlobals();
  vi.restoreAllMocks();
  resetSidebarBootstrapCacheForTest();
  window.localStorage.clear();
});

function navigation(count = 1): SidebarBootstrapResponse {
  return makeSidebarBootstrapResponse({
    projects: [
      makeProjectWithThreadsResponse({
        id: "proj_picker",
        name: "Picker project",
        threads: Array.from({ length: count }, (_, index) =>
          makeThreadListEntry({
            id: `thr_picker_${index}`,
            projectId: "proj_picker",
            title: `Catalog entry ${index}`,
            titleFallback: null,
            createdAt: index + 1,
            updatedAt: index + 1,
          }),
        ),
      }),
    ],
  });
}

function setup(initial: SidebarBootstrapResponse) {
  let serverNavigation = initial;
  const pathQueries: string[] = [];
  vi.spyOn(sdk.system, "config").mockResolvedValue(makeSystemConfig());
  vi.stubGlobal(
    "fetch",
    vi.fn(async (input: RequestInfo | URL) => {
      const url = new URL(
        input instanceof Request ? input.url : input.toString(),
        "http://localhost",
      );
      let body: unknown;
      if (url.pathname === "/api/v1/sidebar-bootstrap") {
        body = serverNavigation;
      } else if (url.pathname === "/api/v1/plugins/contributions") {
        body = { threadActions: [], mentionProviders: [] };
      } else if (url.pathname === "/api/v1/projects/proj_picker/paths") {
        const query = url.searchParams.get("query") ?? "";
        pathQueries.push(query);
        if (query === "Catalog entry") return new Promise<Response>(() => {});
        body = {
          paths:
            query === "cedar"
              ? [
                  {
                    kind: "file",
                    path: "notes/cedar.md",
                    name: "cedar.md",
                    score: 100,
                    positions: [],
                  },
                ]
              : [],
        };
      } else if (url.pathname === "/api/v1/threads") {
        body = serverNavigation.projects.flatMap((project) => project.threads);
      } else {
        throw new Error(`Unexpected request: ${url.pathname}`);
      }
      return new Response(JSON.stringify(body), {
        headers: { "content-type": "application/json" },
      });
    }),
  );
  const { queryClient, wrapper } = createQueryClientTestHarness();
  queryClients.push(queryClient);
  queryClient.setQueryData(sidebarNavigationQueryKey(), initial);
  const hook = renderHook(
    () =>
      usePromptMentions("proj_picker", {
        environmentId: null,
      }),
    { wrapper },
  );
  return {
    ...hook,
    pathQueries,
    updateServer(next: SidebarBootstrapResponse) {
      serverNavigation = next;
    },
    search(query: string | null) {
      act(() => hook.result.current.setQuery(query, "@"));
    },
  };
}

it("finds an exact title after the first two hundred sidebar threads", async () => {
  const picker = setup(navigation(215));
  picker.search("Catalog entry 214");
  await waitFor(() =>
    expect(picker.pathQueries).toContain("Catalog entry 214"),
  );
  await waitFor(() =>
    expect(picker.result.current.results.suggestions).toContainEqual(
      expect.objectContaining({ kind: "thread", threadId: "thr_picker_214" }),
    ),
  );
});

it("refreshes a server rename when mentions reopen without a realtime event", async () => {
  const initial = navigation();
  const picker = setup(initial);
  picker.search("Catalog entry 0");
  await waitFor(() =>
    expect(picker.result.current.results.suggestions).toContainEqual(
      expect.objectContaining({ kind: "thread", threadId: "thr_picker_0" }),
    ),
  );
  picker.search(null);
  picker.updateServer(navigationWithRenamedThread(initial));
  picker.search("Revised checklist");
  await waitFor(() =>
    expect(picker.result.current.results.suggestions).toContainEqual(
      expect.objectContaining({
        kind: "thread",
        threadId: "thr_picker_0",
        title: "Revised checklist",
      }),
    ),
  );
});

function navigationWithRenamedThread(
  initial: SidebarBootstrapResponse,
): SidebarBootstrapResponse {
  return {
    ...initial,
    projects: initial.projects.map((project) => ({
      ...project,
      threads: project.threads.map((thread) => ({
        ...thread,
        title: "Revised checklist",
      })),
    })),
  };
}

it("discovers a server project when mentions reopen without a realtime event", async () => {
  const initial = navigation();
  const picker = setup(initial);
  picker.search("Picker project");
  await waitFor(() =>
    expect(picker.result.current.results.suggestions).toContainEqual(
      expect.objectContaining({ kind: "project", projectId: "proj_picker" }),
    ),
  );
  picker.search(null);
  picker.updateServer({
    ...initial,
    projects: [
      ...initial.projects,
      makeProjectWithThreadsResponse({
        id: "proj_added",
        name: "Additional workspace",
      }),
    ],
  });
  picker.search("Additional workspace");
  await waitFor(() =>
    expect(picker.result.current.results.suggestions).toContainEqual(
      expect.objectContaining({ kind: "project", projectId: "proj_added" }),
    ),
  );
});

it.each(["debounce", "request"])(
  "removes outdated path rows during %s",
  async (stage) => {
    const picker = setup(navigation());
    picker.search("cedar");
    await waitFor(() =>
      expect(picker.result.current.results.suggestions).toContainEqual(
        expect.objectContaining({ kind: "path", path: "notes/cedar.md" }),
      ),
    );
    picker.search("Catalog entry");
    if (stage === "request") {
      await waitFor(() =>
        expect(picker.pathQueries).toContain("Catalog entry"),
      );
    }
    expect(picker.result.current.results.suggestions).toContainEqual(
      expect.objectContaining({ kind: "thread", threadId: "thr_picker_0" }),
    );
    expect(
      picker.result.current.results.suggestions.filter(
        (row) => row.kind === "path",
      ),
    ).toEqual([]);
  },
);

5. Root cause

Candidate coverage is capped before matching

Candidate selection slices deduplicated sidebar candidates to 200 before the mention matcher sees the query. The later exact match cannot recover a thread that has already been excluded.

return Array.from(candidatesById.values()).slice(0, limit);

Freshness depends entirely on cache patch delivery

Sidebar candidates override the list fetch disables the fallback fetch as soon as sidebar candidates exist. The shared sidebar query uses the Infinity-staleness policy. Re-enabling the mention hook does not fetch a new baseline. This is a recovery gap when an event does not reach the cache, not proof that normal realtime updates fail.

Path source publishes data without checking query ownership

Debounced input state identifies pending input, but The path result assembly does not gate on that state. The project path query retains previous data as placeholder data. Thus hiding paths only during the debounce would still let old rows return once the new request starts. The mention adapter forwards those rows unchanged. Loading aggregation can hide pending source work when any other row exists.

6. Proposed fix and checked repair

A contained client-hooks patch makes the mention observer request a fresh sidebar baseline when re-enabled, without changing the default sidebar cache policy. It removes the pre-match cap from the complete sidebar candidate set while retaining existing hidden/archive filtering and the final display limit. At the path source boundary it suppresses rows during debounce and excludes per-source placeholder data during replacement requests.

The existing sidebar endpoint assembles all active project threads; no new endpoint or protocol is needed. The startup-only list fallback remains capped at 200; once the complete bootstrap arrives it is superseded. This repair does not introduce server-side mention search, change ranking policy, or promise freshness during an event loss while the same picker stays open.

Checked patch: 5 files, 244 additions + 13 deletions = 257 changed text lines; no binary, dependency, schema, migration, generated-file, or public-protocol change. All 74 relevant tests across 10 files pass after the repair. App lint and typecheck pass; lint emits 251 warnings and zero errors. git diff --check passes.

Test Files  10 passed (10)
     Tests  74 passed (74)
Lint: Found 251 warnings and 0 errors.
Lint/typecheck: 5 successful tasks, exit 0.

7. Verification

The same agent repeated the reproduction in a second clean detached worktree at the exact base commit, separate from the first checkout. Before adding the new test, the second checkout was clean. Only the newly authored test artifact was copied; no production changes were copied. Frozen install and the complete build succeeded. The same three-file Turbo command then reproduced all five expected failures and passed the two existing hook tests. No report correction was required. This is a second clean run, not an independent reviewer.

8. Related issues and PRs

No open pull request linking issue 5475 was found in its GitHub timeline or the open-PR search at the safety check. No linked branch was checked out. Other performance reports are not needed to explain these deterministic data-correctness failures; this report makes no duplicate claim.

9. Appendix

Issue text and comments were treated as untrusted claims. No issue-supplied command, patch, test file, branch, or external link was executed or fetched. The tests were written from trusted repository hooks and existing fixtures. No user runtime data or credentials are included.

Fixed-suite command:

pnpm exec turbo run test --filter=@bb/app -- src/hooks/usePromptMentions.coverage.test.tsx src/hooks/usePromptMentions.test.tsx src/hooks/usePromptMentions.thread-context.test.tsx src/hooks/usePathSuggestions.test.ts src/hooks/queries/thread-queries.test.tsx src/hooks/queries/sidebar-navigation-query.test.tsx src/hooks/pathMentionSuggestions.test.ts src/hooks/threadMentionSuggestions.test.ts src/hooks/namedMentionSuggestions.test.ts src/hooks/promptMentionCandidates.test.ts
pnpm exec turbo run lint typecheck --filter=@bb/app
git diff --check
git diff --numstat origin/main
First clean baseline run: full output
• turbo 2.10.12

   • Packages in scope: @bb/app
   • Running test in 1 packages
   • Remote caching disabled

//:ensure-native-modules: cache bypass, force executing 18e6fa819535140a
@bb/templates:generate:plugin-scaffold: cache hit, replaying logs 0ee73a84777cbd61
@bb/templates:generate:plugin-scaffold:
@bb/templates:generate:plugin-scaffold: > @bb/templates@0.0.1 generate:plugin-scaffold <first-checkout>/packages/templates
@bb/templates:generate:plugin-scaffold: > node ./scripts/generate-plugin-scaffold.mjs
@bb/templates:generate:plugin-scaffold:
@bb/templates:generate:templates: cache hit, replaying logs 510f0a9eabf26c2c
@bb/templates:generate:templates:
@bb/templates:generate:templates: > @bb/templates@0.0.1 generate:templates <first-checkout>/packages/templates
@bb/templates:generate:templates: > node ./scripts/generate-templates.mjs
@bb/templates:generate:templates:
@bb/plugin-build:generate: cache hit, replaying logs 80046fa6efaf713d
@bb/plugin-build:generate:
@bb/plugin-build:generate: > @bb/plugin-build@0.0.1 generate <first-checkout>/packages/plugin-build
@bb/plugin-build:generate: > node ./scripts/generate-plugin-theme.mjs && node ./scripts/generate-runtime-export-manifest.mjs
@bb/plugin-build:generate:
@bb/plugin-build:generate: plugin-theme.generated.ts up to date
@bb/plugin-build:generate: wrote <first-checkout>/packages/plugin-build/src/generated/runtime-export-manifest.generated.ts (react@19.2.4)
//:ensure-native-modules:
//:ensure-native-modules: > bb@ ensure-native-modules <first-checkout>
//:ensure-native-modules: > node scripts/ensure-native-modules.mjs
//:ensure-native-modules:
@bb/app:test: cache miss, executing d718e0853b9511d5
@bb/app:test:
@bb/app:test: > @bb/app@0.0.1 test <first-checkout>/apps/app
@bb/app:test: > node scripts/generate-pwa-icons.mjs --check && vitest run --config vitest.config.ts "src/hooks/usePromptMentions.coverage.test.tsx" "src/hooks/usePromptMentions.test.tsx" "src/hooks/usePromptMentions.thread-context.test.tsx"
@bb/app:test:
@bb/app:test:
@bb/app:test:  RUN  v4.1.1 <first-checkout>/apps/app
@bb/app:test:
@bb/app:test:  ✓ |@bb/app:isolated| src/hooks/usePromptMentions.thread-context.test.tsx (1 test) 17ms
@bb/app:test:  ✓ |@bb/app:isolated| src/hooks/usePromptMentions.test.tsx (1 test) 234ms
@bb/app:test:  ❯ |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx (5 tests | 5 failed) 3687ms
@bb/app:test:    × finds an exact title after the first two hundred sidebar threads 1194ms
@bb/app:test:    × refreshes a server rename when mentions reopen without a realtime event 1010ms
@bb/app:test:    × discovers a server project when mentions reopen without a realtime event 1009ms
@bb/app:test:    × removes outdated path rows during debounce 162ms
@bb/app:test:    × removes outdated path rows during request 311ms
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 5 ⎯⎯⎯⎯⎯⎯⎯
@bb/app:test:
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > finds an exact title after the first two hundred sidebar threads
@bb/app:test: AssertionError: expected [] to deep equally contain ObjectContaining{…}
@bb/app:test:
@bb/app:test: Ignored nodes: comments, script, style
@bb/app:test: <html>
@bb/app:test:   <head />
@bb/app:test:   <body>
@bb/app:test:     <div />
@bb/app:test:   </body>
@bb/app:test: </html>
@bb/app:test:
@bb/app:test: - Expected:
@bb/app:test: ObjectContaining {
@bb/app:test:   "kind": "thread",
@bb/app:test:   "threadId": "thr_picker_214",
@bb/app:test: }
@bb/app:test:
@bb/app:test: + Received:
@bb/app:test: []
@bb/app:test:
@bb/app:test:  ❯ src/hooks/usePromptMentions.coverage.test.tsx:123:55
@bb/app:test:     121|   );
@bb/app:test:     122|   await waitFor(() =>
@bb/app:test:     123|     expect(picker.result.current.results.suggestions).toContainEqual(
@bb/app:test:        |                                                       ^
@bb/app:test:     124|       expect.objectContaining({ kind: "thread", threadId: "thr_picker_…
@bb/app:test:     125|     ),
@bb/app:test:  ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/config.js:47:12
@bb/app:test:
@bb/app:test:  Test Files  1 failed | 2 passed (3)
@bb/app:test:       Tests  5 failed | 2 passed (7)
@bb/app:test:    Start at  04:31:35
@bb/app:test:  ❯ checkCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:124:77
@bb/app:test:    Duration  7.65s (transform 4.94s, setup 511ms, import 7.45s, tests 3.94s, environment 3.15s)
@bb/app:test:
@bb/app:test:  ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:118:16
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/5]⎯
@bb/app:test:
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > refreshes a server rename when mentions reopen without a realtime event
@bb/app:test: AssertionError: expected [] to deep equally contain ObjectContaining{…}
@bb/app:test:
@bb/app:test: Ignored nodes: comments, script, style
@bb/app:test: <html>
@bb/app:test:   <head />
@bb/app:test:   <body>
@bb/app:test:     <div />
@bb/app:test:   </body>
@bb/app:test: </html>
@bb/app:test:
@bb/app:test: - Expected:
@bb/app:test: ObjectContaining {
@bb/app:test:   "kind": "thread",
@bb/app:test:   "threadId": "thr_picker_0",
@bb/app:test:   "title": "Revised checklist",
@bb/app:test: }
@bb/app:test:
@bb/app:test: + Received:
@bb/app:test: []
@bb/app:test:
@bb/app:test:  ❯ src/hooks/usePromptMentions.coverage.test.tsx:142:55
@bb/app:test:     140|   picker.search("Revised checklist");
@bb/app:test:     141|   await waitFor(() =>
@bb/app:test:     142|     expect(picker.result.current.results.suggestions).toContainEqual(
@bb/app:test:        |                                                       ^
@bb/app:test:     143|       expect.objectContaining({
@bb/app:test:     144|         kind: "thread",
@bb/app:test:  ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/config.js:47:12
@bb/app:test:  ❯ checkCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:124:77
@bb/app:test:  ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:118:16
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/5]⎯
@bb/app:test:
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > discovers a server project when mentions reopen without a realtime event
@bb/app:test: AssertionError: expected [] to deep equally contain ObjectContaining{…}
@bb/app:test:
@bb/app:test: Ignored nodes: comments, script, style
@bb/app:test: <html>
@bb/app:test:   <head />
@bb/app:test:   <body>
@bb/app:test:     <div />
@bb/app:test:   </body>
@bb/app:test: </html>
@bb/app:test:
@bb/app:test: - Expected:
@bb/app:test: ObjectContaining {
@bb/app:test:   "kind": "project",
@bb/app:test:   "projectId": "proj_added",
@bb/app:test: }
@bb/app:test:
@bb/app:test: + Received:
@bb/app:test: []
@bb/app:test:
@bb/app:test:  ❯ src/hooks/usePromptMentions.coverage.test.tsx:189:55
@bb/app:test:     187|   picker.search("Additional workspace");
@bb/app:test:     188|   await waitFor(() =>
@bb/app:test:     189|     expect(picker.result.current.results.suggestions).toContainEqual(
@bb/app:test:        |                                                       ^
@bb/app:test:     190|       expect.objectContaining({ kind: "project", projectId: "proj_adde…
@bb/app:test:     191|     ),
@bb/app:test:  ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/config.js:47:12
@bb/app:test:  ❯ checkCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:124:77
@bb/app:test:  ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:118:16
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/5]⎯
@bb/app:test:
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > removes outdated path rows during debounce
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > removes outdated path rows during request
@bb/app:test: AssertionError: expected [ { kind: 'path', …(5) } ] to deeply equal []
@bb/app:test:
@bb/app:test: - Expected
@bb/app:test: + Received
@bb/app:test:
@bb/app:test: - []
@bb/app:test: + [
@bb/app:test: +   {
@bb/app:test: +     "entryKind": "file",
@bb/app:test: +     "kind": "path",
@bb/app:test: +     "name": "cedar.md",
@bb/app:test: +     "path": "notes/cedar.md",
@bb/app:test: +     "replacement": "notes/cedar.md",
@bb/app:test: +     "source": "workspace",
@bb/app:test: +   },
@bb/app:test: + ]
@bb/app:test:
@bb/app:test:  ❯ src/hooks/usePromptMentions.coverage.test.tsx:218:7
@bb/app:test:     216|         (row) => row.kind === "path",
@bb/app:test:     217|       ),
@bb/app:test:     218|     ).toEqual([]);
@bb/app:test:        |       ^
@bb/app:test:     219|   },
@bb/app:test:     220| );
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/5]⎯
@bb/app:test:
@bb/app:test:  ELIFECYCLE  Test failed. See above for more details.
@bb/app#test:  ERROR  command (<first-checkout>/apps/app) /usr/local/bin/pnpm run test src/hooks/usePromptMentions.coverage.test.tsx src/hooks/usePromptMentions.test.tsx src/hooks/usePromptMentions.thread-context.test.tsx exited (1)

 Tasks:    4 successful, 5 total
Cached:    3 cached, 5 total
  Time:    10.121s
Failed:    @bb/app#test

 ERROR  run failed: command  exited (1)
Second clean baseline run: full output
• turbo 2.10.12

   • Packages in scope: @bb/app
   • Running test in 1 packages
   • Remote caching disabled, using shared worktree cache

@bb/templates:generate:plugin-scaffold: cache hit, replaying logs 0ee73a84777cbd61
//:ensure-native-modules: cache bypass, force executing 18e6fa819535140a
@bb/templates:generate:plugin-scaffold:
@bb/templates:generate:plugin-scaffold: > @bb/templates@0.0.1 generate:plugin-scaffold <first-checkout>/packages/templates
@bb/templates:generate:plugin-scaffold: > node ./scripts/generate-plugin-scaffold.mjs
@bb/templates:generate:plugin-scaffold:
@bb/plugin-build:generate: cache hit, replaying logs 80046fa6efaf713d
@bb/templates:generate:templates: cache hit, replaying logs 510f0a9eabf26c2c
@bb/plugin-build:generate:
@bb/plugin-build:generate: > @bb/plugin-build@0.0.1 generate <first-checkout>/packages/plugin-build
@bb/plugin-build:generate: > node ./scripts/generate-plugin-theme.mjs && node ./scripts/generate-runtime-export-manifest.mjs
@bb/plugin-build:generate:
@bb/plugin-build:generate: plugin-theme.generated.ts up to date
@bb/plugin-build:generate: wrote <first-checkout>/packages/plugin-build/src/generated/runtime-export-manifest.generated.ts (react@19.2.4)
@bb/templates:generate:templates:
@bb/templates:generate:templates: > @bb/templates@0.0.1 generate:templates <first-checkout>/packages/templates
@bb/templates:generate:templates: > node ./scripts/generate-templates.mjs
@bb/templates:generate:templates:
//:ensure-native-modules:
//:ensure-native-modules: > bb@ ensure-native-modules <second-checkout>
//:ensure-native-modules: > node scripts/ensure-native-modules.mjs
//:ensure-native-modules:
@bb/app:test: cache miss, executing a2423ac9baaf5b27
@bb/app:test:
@bb/app:test: > @bb/app@0.0.1 test <second-checkout>/apps/app
@bb/app:test: > node scripts/generate-pwa-icons.mjs --check && vitest run --config vitest.config.ts "src/hooks/usePromptMentions.coverage.test.tsx" "src/hooks/usePromptMentions.test.tsx" "src/hooks/usePromptMentions.thread-context.test.tsx"
@bb/app:test:
@bb/app:test:
@bb/app:test:  RUN  v4.1.1 <second-checkout>/apps/app
@bb/app:test:
@bb/app:test:  ✓ |@bb/app:isolated| src/hooks/usePromptMentions.thread-context.test.tsx (1 test) 17ms
@bb/app:test:  ✓ |@bb/app:isolated| src/hooks/usePromptMentions.test.tsx (1 test) 234ms
@bb/app:test:  ❯ |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx (5 tests | 5 failed) 3692ms
@bb/app:test:    × finds an exact title after the first two hundred sidebar threads 1196ms
@bb/app:test:    × refreshes a server rename when mentions reopen without a realtime event 1015ms
@bb/app:test:    × discovers a server project when mentions reopen without a realtime event 1009ms
@bb/app:test:    × removes outdated path rows during debounce 160ms
@bb/app:test:    × removes outdated path rows during request 311ms
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 5 ⎯⎯⎯⎯⎯⎯⎯
@bb/app:test:
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > finds an exact title after the first two hundred sidebar threads
@bb/app:test: AssertionError: expected [] to deep equally contain ObjectContaining{…}
@bb/app:test:
@bb/app:test: Ignored nodes: comments, script, style
@bb/app:test: <html>
@bb/app:test:   <head />
@bb/app:test:   <body>
@bb/app:test:     <div />
@bb/app:test:   </body>
@bb/app:test: </html>
@bb/app:test:
@bb/app:test: - Expected:
@bb/app:test: ObjectContaining {
@bb/app:test:   "kind": "thread",
@bb/app:test:   "threadId": "thr_picker_214",
@bb/app:test: }
@bb/app:test:
@bb/app:test: + Received:
@bb/app:test: []
@bb/app:test:
@bb/app:test:  ❯ src/hooks/usePromptMentions.coverage.test.tsx:125:55
@bb/app:test:     123|   );
@bb/app:test:     124|   await waitFor(() =>
@bb/app:test:     125|     expect(picker.result.current.results.suggestions).toContainEqual(
@bb/app:test:        |                                                       ^
@bb/app:test:     126|       expect.objectContaining({ kind: "thread", threadId: "thr_picker_…
@bb/app:test:     127|     ),
@bb/app:test:  ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/config.js:47:12
@bb/app:test:  ❯ checkCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:124:77
@bb/app:test:  ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:118:16
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/5]⎯
@bb/app:test:
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > refreshes a server rename when mentions reopen without a realtime event
@bb/app:test: AssertionError: expected [] to deep equally contain ObjectContaining{…}
@bb/app:test:
@bb/app:test: Ignored nodes: comments, script, style
@bb/app:test: <html>
@bb/app:test:   <head />
@bb/app:test:   <body>
@bb/app:test:     <div />
@bb/app:test:   </body>
@bb/app:test: </html>
@bb/app:test:
@bb/app:test: - Expected:
@bb/app:test: ObjectContaining {
@bb/app:test:   "kind": "thread",
@bb/app:test:   "threadId": "thr_picker_0",
@bb/app:test:   "title": "Revised checklist",
@bb/app:test: }
@bb/app:test:
@bb/app:test: + Received:
@bb/app:test: []
@bb/app:test:
@bb/app:test:  ❯ src/hooks/usePromptMentions.coverage.test.tsx:144:55
@bb/app:test:     142|   picker.search("Revised checklist");
@bb/app:test:     143|   await waitFor(() =>
@bb/app:test:     144|     expect(picker.result.current.results.suggestions).toContainEqual(
@bb/app:test:        |                                                       ^
@bb/app:test:     145|       expect.objectContaining({
@bb/app:test:     146|         kind: "thread",
@bb/app:test:  ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/config.js:47:12
@bb/app:test:  ❯ checkCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:124:77
@bb/app:test:  ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:118:16
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/5]⎯
@bb/app:test:
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > discovers a server project when mentions reopen without a realtime event
@bb/app:test: AssertionError: expected [] to deep equally contain ObjectContaining{…}
@bb/app:test:
@bb/app:test: Ignored nodes: comments, script, style
@bb/app:test: <html>
@bb/app:test:   <head />
@bb/app:test:   <body>
@bb/app:test:     <div />
@bb/app:test:   </body>
@bb/app:test: </html>
@bb/app:test:
@bb/app:test: - Expected:
@bb/app:test: ObjectContaining {
@bb/app:test:   "kind": "project",
@bb/app:test:   "projectId": "proj_added",
@bb/app:test: }
@bb/app:test:
@bb/app:test: + Received:
@bb/app:test: []
@bb/app:test:
@bb/app:test:  ❯ src/hooks/usePromptMentions.coverage.test.tsx:191:55
@bb/app:test:     189|   picker.search("Additional workspace");
@bb/app:test:     190|   await waitFor(() =>
@bb/app:test:     191|     expect(picker.result.current.results.suggestions).toContainEqual(
@bb/app:test:        |                                                       ^
@bb/app:test:     192|       expect.objectContaining({ kind: "project", projectId: "proj_adde…
@bb/app:test:     193|     ),
@bb/app:test:  ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/config.js:47:12
@bb/app:test:  ❯ checkCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:124:77
@bb/app:test:  ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/dist/wait-for.js:118:16
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/5]⎯
@bb/app:test:
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > removes outdated path rows during debounce
@bb/app:test:  FAIL  |@bb/app:isolated| src/hooks/usePromptMentions.coverage.test.tsx > removes outdated path rows during request
@bb/app:test:
@bb/app:test:  Test Files  1 failed | 2 passed (3)
@bb/app:test:       Tests  5 failed | 2 passed (7)
@bb/app:test: AssertionError: expected [ { kind: 'path', …(5) } ] to deeply equal []
@bb/app:test:
@bb/app:test: - Expected
@bb/app:test:    Start at  04:38:52
@bb/app:test:    Duration  7.66s (transform 4.67s, setup 549ms, import 7.14s, tests 3.94s, environment 3.46s)
@bb/app:test:
@bb/app:test: + Received
@bb/app:test:
@bb/app:test: - []
@bb/app:test: + [
@bb/app:test: +   {
@bb/app:test: +     "entryKind": "file",
@bb/app:test: +     "kind": "path",
@bb/app:test: +     "name": "cedar.md",
@bb/app:test: +     "path": "notes/cedar.md",
@bb/app:test: +     "replacement": "notes/cedar.md",
@bb/app:test: +     "source": "workspace",
@bb/app:test: +   },
@bb/app:test: + ]
@bb/app:test:
@bb/app:test:  ❯ src/hooks/usePromptMentions.coverage.test.tsx:220:7
@bb/app:test:     218|         (row) => row.kind === "path",
@bb/app:test:     219|       ),
@bb/app:test:     220|     ).toEqual([]);
@bb/app:test:        |       ^
@bb/app:test:     221|   },
@bb/app:test:     222| );
@bb/app:test:
@bb/app:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/5]⎯
@bb/app:test:
@bb/app:test:  ELIFECYCLE  Test failed. See above for more details.
@bb/app#test:  ERROR  command (<second-checkout>/apps/app) /usr/local/bin/pnpm run test src/hooks/usePromptMentions.coverage.test.tsx src/hooks/usePromptMentions.test.tsx src/hooks/usePromptMentions.thread-context.test.tsx exited (1)

 Tasks:    4 successful, 5 total
Cached:    3 cached, 5 total
  Time:    10.131s
Failed:    @bb/app#test

 ERROR  run failed: command  exited (1)