🚨 SLOP COP 🚨 · new-issue-autopilot
#7547 · Provider badge disappears with a server-only directory
Trusted base: f024a372f0e1e0670f6fd7452ebcd1341f639c95, fetched from origin/main and cross-checked against the get-bb/bb main API commit.
Verdict: PARTIALLY REPRODUCED · Root-cause confidence: high
1. TL;DR
The sidebar component renders no provider badge when its directory omits the thread’s provider, even when the thread carries a remote host and environment. A fresh two-case component test demonstrates this on unchanged production code, and the same agent repeated it in a second clean checkout at the same trusted commit. The directory supplied by the real sidebar comes from an unscoped provider-list hook; server discovery without a scope uses the primary host, not each thread’s environment. Existing server integration tests separately confirm host-dependent discovery. A real enrolled remote machine and a desktop/browser end-to-end reproduction were not exercised, so the verdict intentionally remains partial.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| A missing provider record suppresses the badge. | Verified at the component boundary | Two clean runs: directory-present control passes; expected badge with server-only directory fails with null. |
| The sidebar reads providers without an environment or host scope. | Verified from trusted source | ProjectList calls experimental_useProviders(); its implementation calls useSystemProviders() without arguments. |
| Installed-only providers differ by machine. | Verified in existing server integration coverage | provider-routing.test.ts verifies primary, explicit-host and environment-host responses against synthetic connected host RPC responders and a real migrated SQLite database. |
| The particular remote agent loses its icon in the released desktop app. | Unverified end to end here | No real remote agent process or enrolled machine was created. Synthetic component data uses a generic provider identifier. |
| The agent has bundled artwork. | Verified statically | plugins/provider-acp/icons/opencode.svg exists. The logo HTTP response was not queried in a live instance. |
| Thread detail can resolve environment-scoped provider metadata. | Verified statically | ThreadDetailView supplies environmentId to useSystemProviderInfo. |
| Compact Recents also has a related symptom. | Not tested | Outside this reproduction’s component boundary; no visual or runtime claim is made for that surface. |
3. Environment and isolation
- Linux x86_64, kernel 4.19.0-gvisor; Node v22.19.0; Vitest v4.1.12; jsdom.
- First checkout: clean trusted main before adding only the two reproduction files. Second checkout: new detached worktree at the exact same commit, fresh frozen install, identical reproduction files.
- No user runtime database, credentials, real provider sessions or production app were accessed. Component fixtures contain synthetic host and environment identifiers only.
- Unit tests need no app port or persisted data directory. Server integration tests allocate their own migrated SQLite fixtures. No real provider CLI version is asserted.
- Full repository build passed after explicitly building the SDK first: 73 successful tasks. The first broad build encountered a missing-SDK-output ordering race; no repository fix was made for that unrelated setup issue.
4. Minimal reproduction
These are new diagnostic files written from trusted repository fixtures and component code, not scripts or patches supplied by the issue. They intentionally do not repair production behavior.
- Clone the trusted target and select the recorded main commit:
git clone https://github.com/get-bb/bb.git bb-repro cd bb-repro git checkout --detach f024a372f0e1e0670f6fd7452ebcd1341f639c95 pnpm install --frozen-lockfile --prefer-offline
- Create
plugins/thread-list/app/rows/issue7547.repro.tsxwith this complete fixture:import { TooltipProvider } from "@/components/ui/tooltip"; import { installTestPluginRuntime, renderSlot } from "@get-bb/plugin-sdk/testing/app"; import type { PluginProvidersState } from "@get-bb/plugin-sdk/app"; import { makeSidebarEnvironment, makeSidebarThread } from "../model/fixtures.js"; import { SidebarProjectsContext } from "../model/use-sidebar-data.js"; import { SidebarRenameProvider } from "./SidebarInlineRename.js"; import { ThreadSelectionProvider } from "../selection/threadSelection.js"; import { ThreadRowNavigationProvider } from "./threadRowNavigation.js"; import { SidebarProvidersContext, ThreadRow } from "./ThreadRow.js"; installTestPluginRuntime(); export const fixtureProvider: PluginProvidersState["providers"][number] = { id: "fixture-remote-agent", pluginId: "fixture-agent", displayName: "Remote fixture agent", logoUrl: "/fixture-logo.svg", available: true, maintenance: { health: false, usage: false, installation: false }, capabilities: { supportsThreadArchive: true, supportsThreadRename: true, supportsServiceTier: false, supportsNativeUserQuestion: false, supportsFork: true, supportsSessionRewind: false, modelCatalogScope: "workspace", permissionModes: ["auto"], }, composerActions: [], completedTurnDisplay: "collapse", }; const fixtureThread = makeSidebarThread({ title: "Remote fixture thread", displayTitle: "Remote fixture thread", providerId: fixtureProvider.id, environment: makeSidebarEnvironment({ id: "env_remote_fixture" }), host: { id: "host_remote_fixture", name: "Remote fixture host" }, }); function FixtureRow({ includeProvider }: { includeProvider: boolean }) { return ( <SidebarProjectsContext.Provider value={[]}> <SidebarProvidersContext.Provider value={includeProvider ? [fixtureProvider] : []}> <TooltipProvider> <ThreadRowNavigationProvider> <ThreadSelectionProvider activeThreadId={null}> <SidebarRenameProvider> <ThreadRow thread={fixtureThread} crossProjectId={null} isActive={false} options={{ kind: "default", depth: 1, isCompact: false }} /> </SidebarRenameProvider> </ThreadSelectionProvider> </ThreadRowNavigationProvider> </TooltipProvider> </SidebarProvidersContext.Provider> </SidebarProjectsContext.Provider> ); } export function renderFixtureRow(includeProvider: boolean) { return renderSlot({ component: FixtureRow }, { includeProvider }, { sidebarThreads: { threads: [fixtureThread], projects: [] }, }); } - Create
plugins/thread-list/app/rows/issue7547.repro.test.tsxwith this complete regression candidate:// @vitest-environment jsdom import { cleanup } from "@testing-library/react"; import { afterEach, describe, expect, it } from "vitest"; import { renderFixtureRow } from "./issue7547.repro.js"; afterEach(cleanup); describe("remote provider badge reproduction", () => { it("renders the badge when the directory contains the thread provider", () => { const slot = renderFixtureRow(true); expect(slot.container.querySelector("[data-sidebar-thread-provider]")?.getAttribute("aria-label")) .toBe("Remote fixture agent"); }); it("preserves a badge for a remote thread when the server directory omits its provider", () => { const slot = renderFixtureRow(false); expect(slot.container.textContent).toContain("Remote fixture thread"); expect(slot.container.querySelector("[data-sidebar-thread-provider]")) .not.toBeNull(); }); }); - Run through Turbo:
pnpm exec turbo run test --filter=bb-plugin-thread-list -- app/rows/issue7547.repro.test.tsx
Expected: a remote thread retains a provider badge when its provider is absent only from the server host’s directory. Actual: the title renders, but the badge element is absent.
âś“ renders the badge when the directory contains the thread provider Ă— preserves a badge for a remote thread when the server directory omits its provider AssertionError: expected null not to be null Test Files 1 failed (1) Tests 1 failed | 1 passed (2) Exit status: 1
The SDK test runtime supplies surrounding hooks and a lightweight provider-icon renderer. The assertions inspect ThreadRow’s actual accessible badge wrapper; they do not assert SVG rendering or provider process discovery. The existing tests cover known-directory badges and expect no badge for unknown provider ids; they do not exercise environment-aware discovery.
Screenshot limitation: BB Browser Automation headless open failed before a session was created: Install Chrome/Chromium on this host or link its executable at the plugin data runtime/chrome path. No screenshot is supplied or fabricated. An unused isolated component harness listener was stopped; no browser, app server or remote daemon remains from this investigation.
5. Root cause
- ProjectList:1316 reads
experimental_useProviders()once and passes its directory to rows through context at lines 1837–1839. - useProviders:291 calls
useSystemProviders()with no lookup scope. - systemProvidersQueryOptions:234 calls the SDK with environmentId or hostId only when explicitly supplied; otherwise it makes an unscoped list request.
- resolveSystemLookupHostId:14 maps an unscoped request to
requireConnectedPrimaryHostId. Provider discovery:272 computes installed provider visibility for that one selected host. - ThreadRow:355 looks up only
thread.providerIdin the supplied context directory. It does not use the thread’s environment or host to repair a miss. - ThreadRow:630 gates the entire tooltip, accessible wrapper and ProviderIcon behind a successful lookup. Missing metadata therefore removes the whole icon region rather than selecting a fallback artwork.
Contrast: Thread detail:623 supplies the actual thread environment when resolving provider information. This explains why opening a thread and rendering its sidebar row can disagree.
Existing integration owner: provider routing contract test. Its synthetic hosts intentionally expose different installed-only providers and prove that explicit environment scoping changes the returned directory.
6. Proposed fix and autopilot decision
Resolve sidebar provider metadata for the thread’s environment or host, with shared/deduplicated requests and correct offline behavior, rather than treating the primary-host directory as a universal catalog. Preserve the existing provider-list picker contract; changing a public SDK hook to return a cross-machine union should be a deliberate API decision, not an incidental cosmetic patch. The browser SDK already supports scoped provider listing; the remaining work is the sidebar’s lookup/caching path and its integration test.
No automatic pull request: the report verifies the component mechanism but only partially reproduces the real remote-host scenario. The rule requires a fully reproduced trusted-main bug before attempting its simple-fix path. No production files were changed, no fix branch was pushed, and no public contract was changed.
7. Verification: second clean run
The same agent created a new detached worktree at the recorded base, ran a fresh frozen install, copied only the two new diagnostic files and ran the identical Turbo command. It again produced one passing control and one expected failure with AssertionError: expected null not to be null. First run: 04:26:23 UTC, 2.47 seconds in Vitest. Second run: 04:27:02 UTC, 2.32 seconds in Vitest. This is a repeat run by the same agent, not independent verification. Both runs used unchanged production code; no correction to the component finding was needed. The report deliberately limits the overall verdict because real remote-host and browser reproduction remain unverified.
8. Existing coverage and PR check
pnpm exec turbo run test --filter=bb-plugin-thread-list -- app/rows/ThreadRow.test.tsx Test Files 1 passed (1) Tests 95 passed (95) pnpm exec turbo run test --filter=@bb/server -- test/system/provider-routing.test.ts test/system/provider-states.test.ts Test Files 2 passed (2) Tests 28 passed (28)
The issue timeline contained no linked pull request, and a numeric open-PR search returned no matches at investigation time. No pull request code was checked out or executed.
9. Related scope and appendix
The report concerns row metadata lookup, not provider artwork generation or provider-picker feature behavior. No related issue’s proposed patch or external link was executed. All issue text, comments and links were treated as untrusted claims; only trusted repository evidence and these agent-authored diagnostic files were run.
Additional setup commands used: git fetch origin main; main-SHA cross-check via GitHub API; pnpm exec turbo run build --filter=@get-bb/plugin-sdk; pnpm exec turbo run build; git diff --check. The main checkout’s build-generated route ordering change was reverted. Diagnostic files and raw logs remain local rather than being committed to this public reports repository. No application dependency was added.
> AGENT GENERATED