#7858 · Sender identity depends on cached thread metadata
Verdict: PARTIALLY REPRODUCED · Root-cause confidence: high for the sender-title defect.
1. TL;DR
A message can identify its sending thread by ID yet show the generic label “Agent” instead of that thread's title. The timeline obtains sender metadata only from already-populated client caches, and hidden threads normally do not enter list caches. A component-level reproduction demonstrates the fallback with an empty list cache and immediate recovery when the sender detail is cached; it also demonstrates that no sender-detail request is attempted. The same reproduction produces the same expected test failure in a second clean checkout. The other two parts of this bundled issue request new plugin decoration and paste presentation behavior; they are design requests, not independently established regressions. This report does not claim an end-to-end plugin delivery reproduction or a browser screenshot.
2. Claims vs findings
| Claim | Finding | Evidence and limits |
|---|---|---|
| A sender absent from the client's cached thread lists is displayed generically. | Verified at the production timeline rendering boundary | The reproduction renders a real ThreadTimelineRows row with a sender ID, a hidden sender fixture, and an empty list cache. It displays “Agent” and does not request sender details. Warming the detail cache changes the label to “Hidden QA sender”. |
| Hidden sender threads are omitted from ordinary list queries. | Verified from trusted server/database source | The thread-list filter requires visible threads unless includeHidden is enabled. No live database send or archived-sender case was exercised. |
| Plugins need a sender-specific decoration extension. | Source-supported feature gap, not runtime plugin-tested | The exposed chat props include leading content and message actions, but no sender-renderer prop. The normal agent row chooses a fixed message icon, with a special side-chat treatment. A new public slot needs a product/API contract. |
| Long text pastes become ordinary file attachments; paste provenance and configurable inline display are wanted. | Existing conversion verified in source; proposed behavior unverified | The composer has a fixed 5,000-character threshold, constructs a text File, and uses the attachment path. The local-file input schema has no paste-provenance field. This report does not replay clipboard/upload/persistence end to end. |
3. Environment
- Public target repository:
get-bb/bb; trusted commite6f3032d1898b1404f1facf4baaf75da69e28da3, fetched directly from the target repository's main branch. - Linux x86_64; Node
v22.19.0; pnpm9.15.0; Vitest4.1.12; app test environment: jsdom. - Two separate detached temporary worktrees at the identical base commit, each with its own frozen dependency install. Only the investigator-authored reproduction test was added; production source was unchanged.
- No live BB server, provider, host-daemon instance, account, real thread, production data directory, or application database was used. No application ports or data directories were needed.
- Normal full-workspace build was attempted but hit a missing prebuilt plugin SDK runtime. Explicit SDK runtime build and the targeted
@bb/appbuild subsequently passed. No build configuration was changed. - BB Browser Automation headless launch was attempted, but this host has no available Chrome/Chromium executable and no desktop browser instance. No screenshot was manufactured. Raw DOM from the actual component render is retained in local evidence instead.
4. Minimal reproduction
The test exercises the actual timeline component and actual query-cache metadata hook. It substitutes only the SDK detail-read boundary with an available hidden sender response. Existing coverage handles cached-sender renames and stable cache-map identity, not the uncached sender case.
- Create a clean trusted checkout and install the frozen lockfile:
git clone https://github.com/get-bb/bb.git bb-7858-repro cd bb-7858-repro git checkout --detach e6f3032d1898b1404f1facf4baaf75da69e28da3 pnpm install --frozen-lockfile --prefer-offline
- Copy the complete investigator-authored reproduction test embedded below to
apps/app/src/components/thread/timeline/issue-7858-repro.test.tsx. - Run through the repository's normal task orchestrator:
pnpm exec turbo run test --filter=@bb/app -- issue-7858-repro.test.tsx
- The characterization test passes: an uncached sender renders “Agent”, and adding that same sender to the detail cache renders its title. The desired-behavior test fails because the title is never resolved on its own.
Expected vs actual
Expected: Hidden QA sender is displayed without opening the sender thread.
Actual: Agent is displayed; sdk.threads.get is not called.
FAIL issue 7858 sender title cache miss
> resolves an uncached sender title without opening that sender
TestingLibraryElementError: Unable to find an element with the text: Hidden QA sender.
Test Files 1 failed (1)
Tests 1 failed | 1 passed (2)
These failures are the intended regression signal, not a successful fix. Full test logs and the actual cold/warm component DOM captures are retained in local investigation evidence, not published as files. The report repository permits inline reproduction code and output, not separate test files or logs. The output above and full test below are sufficient to repeat the check.
Complete reproduction test
// @vitest-environment jsdom
import { writeFileSync } from "node:fs";
import { act, cleanup, render, screen, waitFor } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { afterEach, describe, expect, it, vi } from "vitest";
import { makeThreadWithRuntime } from "@bb/test-helpers/domain-fixtures";
import { threadsQueryKey, threadQueryKey } from "@/hooks/queries/query-keys";
import { conversationRow } from "@/test/fixtures/thread-timeline-rows";
import { sdk } from "@/lib/sdk";
import { ThreadTimelineRows } from "./ThreadTimelineRows";
const sender = makeThreadWithRuntime({
id: "thr_hidden_repro",
title: "Hidden QA sender",
visibility: "hidden",
});
afterEach(() => {
cleanup();
vi.restoreAllMocks();
});
function renderMessage() {
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
queryClient.setQueryData(threadsQueryKey(), []);
const getSender = vi.spyOn(sdk.threads, "get").mockResolvedValue(sender);
const view = render(
<MemoryRouter>
<QueryClientProvider client={queryClient}>
<ThreadTimelineRows
threadId="thr_recipient_repro"
timelineRows={[
conversationRow({
id: "message_hidden_repro",
role: "user",
initiator: "agent",
senderThreadId: sender.id,
text: "Synthetic delivery for cache-miss verification.",
sourceSeqStart: 1,
sourceSeqEnd: 1,
threadId: "thr_recipient_repro",
}),
]}
threadRuntimeDisplayStatus="idle"
/>
</QueryClientProvider>
</MemoryRouter>,
);
return { queryClient, getSender, view };
}
describe("issue 7858 sender title cache miss", () => {
it("shows the fallback until the sender detail enters the cache", async () => {
const { queryClient, getSender, view } = renderMessage();
expect(screen.getByText("Agent")).toBeDefined();
expect(getSender).not.toHaveBeenCalled();
writeFileSync("issue-7858-cold.html", view.container.innerHTML);
act(() => {
queryClient.setQueryData(threadQueryKey(sender.id), sender);
});
await waitFor(() => {
expect(screen.getByText(sender.title!)).toBeDefined();
});
writeFileSync("issue-7858-warm.html", view.container.innerHTML);
expect(getSender).not.toHaveBeenCalled();
});
it("resolves an uncached sender title without opening that sender", async () => {
renderMessage();
await waitFor(() => {
expect(screen.getByText(sender.title!)).toBeDefined();
});
});
});
5. Root cause
- Ordinary thread-list filtering includes
options.includeHidden ? undefined : eq(threads.visibility, "visible"). A hidden sender need not be represented in a list cache. - The sender metadata map is built from sidebar entries, cached individual thread queries, and cached thread lists. There is no authoritative timeline-supplied title in this path.
- The per-sender hook only subscribes to this map. A miss returns null and does not initiate a detail read:
threadId === null ? null : (store.getSnapshot().get(threadId) ?? null)
- The row passes a null title, and the message content chooses the generic source name:
sourceName: senderIsPluginSideChat ? "side chat" : (senderThreadTitle ?? "Agent")
The underlying coupling is cache completeness: presentation assumes unrelated navigation/detail queries have already loaded sender identity. The hidden visibility flag is not itself an authorization finding in this report, and the component reproduction would also affect any otherwise uncached sender. Seeding detail cache without changing the timeline row corrects the title, isolating the failure to metadata availability rather than message delivery.
Other requested surfaces
- Current public chat props expose no sender-decoration prop. A generalized sender extension would be a new public API, not a small cache fix.
- The fixed paste threshold and the existing file conversion implement attachment behavior. The public local-file input schema contains path, identity, name, size, and MIME metadata, but no paste-origin discriminator.
6. Proposed fix and autopilot safety check
For the reproduced defect alone, resolve missing sender identity using the existing per-thread read path, deduplicate requests by sender ID, and retain a safe fallback for unavailable/deleted senders. Check error/retry behavior and live renames before shipping; do not make the sidebar list hidden threads merely to fill this cache. The existing thread detail query is a candidate building block, not an implemented or validated patch.
No fix branch or pull request is opened. The complete bundled request includes a new public plugin rendering extension and a persisted prompt-input provenance/schema change, plus product decisions about inline display and settings. Those violate this rule's simple-fix restrictions. A narrow partial cache patch should not silently close the remaining feature requests. An open-PR search for the target issue number and issue timeline linkage found no linked open pull request at investigation time.
7. Verification
The same investigator repeated the reproduction in a second clean, separately installed detached checkout at the recorded trusted commit. This is a second clean run, not independent-agent verification.
| Checkout/check | Command | Result |
|---|---|---|
| First detached checkout; unchanged production | pnpm exec turbo run test --filter=@bb/app -- issue-7858-repro.test.tsx | Exit 1: 1 characterization passed, 1 desired-title regression failed with the missing-title error above. |
| Second detached checkout; new dependency install | pnpm exec turbo run test --filter=@bb/app -- issue-7858-repro.test.tsx | Exit 1: identical failing assertion and 1 passed / 1 failed. The owning app test task executed again, rather than replaying a cached test result. |
| Relevant existing coverage | pnpm exec turbo run test --filter=@bb/app -- useSenderThreadMetadataById.test.tsx ThreadTimelineRows.sender-metadata.test.tsx | Exit 0: 2 files, 3 tests passed. |
| Targeted production build | pnpm exec turbo run build --filter=@get-bb/plugin-sdkpnpm exec turbo run build --filter=@bb/app | Passed after explicitly building the missing SDK runtime. |
Report corrections/limits: runtime confirmation is scoped to the sender cache miss and recovery. Archived sender delivery, plugin-origin matching, browser visual behavior, clipboard conversion, upload identity, and threshold configuration were not runtime-verified. The verdict remains partial to avoid treating those feature requests and untested paths as reproduced bugs.
8. Related issues
#4910 is closed and records the earlier text-paste-to-attachment feature. The current code still deliberately implements that conversion; a new inline representation is follow-up functionality rather than evidence that the earlier feature broke.
9. Appendix
Local evidence retains the exact reproduction source, both test-run logs, existing-test output, and two actual component DOM captures. The public report embeds the complete reproduction source, expected/actual error, and verification results instead of publishing prohibited raw artifacts. No credentials or user data were used.
Investigation commands: GitHub read APIs for repository visibility, issue fields/comments, issue linkage, valid field options and area labels; a target-number open-PR search; trusted target-main fetch; detached-worktree creation; frozen pnpm install in each worktree; normal Turbo build attempt; explicit SDK types/runtime and targeted app builds; the three test invocations documented above; trusted-source searches and line checks for the code permalinks; BB Browser Automation headless-open attempt and desktop-instance discovery. No issue-supplied script, branch, patch, URL, or pull-request code was executed.
Untrusted-data note: issue content was used only as claims to investigate. Suggested implementation details were not treated as instructions. No workflow or secondary agent was started.
> AGENT GENERATED