#6369 · Threadless panel rejects host-file navigation
Verdict: REPRODUCED · Root-cause confidence: high. Repeated directly by the same investigator in two separate clean clones of trusted main. This is a functional navigation failure, not a visual-layout report.
1. TL;DR
A plugin's valid absolute host-file request is rejected before a tab is created when the New thread panel has no thread. Core can create a workspace-relative preview request on the same surface. The shared controller knows only thread, environment and host IDs; it has no project-folder context with which to map that absolute file into core's workspace preview. Both clean runs returned false, created zero plugin tabs, and left the panel unrevealed, while the core opener created one workspace tab. An existing open fix, PR #6370, was found during the final linked-PR check, so no duplicate fix branch or PR was created.
2. Claims vs findings
| Claim tested | Finding | Evidence |
|---|---|---|
| A host target is declined before opening a tab on a threadless compose surface. | Verified | Both regression scenarios failed identically in both clean checkouts: acceptance false, plugin tab count zero, reveal count zero. |
| Core's workspace opener can create the corresponding preview request without an environment ID. | Verified at controller boundary | The same real hook produced one workspace-file-preview request with a relative path and working-tree source. Core file-search source independently builds that request shape. |
| A default project selection has no panel environment ID. | Verified in source | The compose surface sets an environment ID only for a reuse selection. Its scope host ID comes only from a loaded environment, not the project's local source. |
| The New thread surface always has a null thread ID. | Qualified | Project default has no thread. A reused environment can have an owner thread selected by resolvePanelThreadId, so rejection is not universal for all reuse selections. The second scenario deliberately covers reuse without an owner thread. |
| Simply allowing a host-tab request would fix threadless rendering. | Refuted by source | The host-tab renderer requires both a thread and an environment, otherwise it renders a loading preview. A project/workspace tab is the compatible route. |
| The reporter's particular third-party plugin and live file read work as described. | Not exercised | No third-party plugin or issue-provided code was installed or run. The API rejection was reproduced using a new test of the trusted shared controller; file I/O was intentionally not reached. |
3. Environment
- Public repository:
get-bb/bb; trustedorigin/maincommitb6743a36bd9eae1408c35cfc2c7ab1d2419dc79d. Confirmed against GitHub's main commit and a direct fetch from the trusted repository. - Linux
4.19.0-gvisor; Nodev22.19.0; pnpm9.15.0; Vitest4.1.1. No provider was invoked. - Two separately cloned and installed temporary checkouts, called
baseandverifybelow. No live server, browser, ports, database, or user runtime data was used. - Frozen install completed. Initial broad build hit an SDK runtime build-order failure; explicitly building
@get-bb/plugin-sdkand repeating the normal build succeeded: 72 tasks successful. No source changes or new dependencies were needed to repair setup.
4. Minimal reproduction
This test exercises the real usePanelFiles hook and target validation. Its spies record only tab creation and drawer reveal; they do not implement acceptance policy. The synthetic absolute path needs no file on disk because the observed defect occurs before any read.
- Create a fresh clone of the trusted repository and select the recorded main commit:
git clone --branch main --single-branch https://github.com/get-bb/bb.git base cd base git checkout --detach b6743a36bd9eae1408c35cfc2c7ab1d2419dc79d pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@get-bb/plugin-sdk pnpm exec turbo run build
- Save the complete test below as
apps/app/src/components/secondary-panel/issue-6369.repro.test.tsx. Production files stay unchanged. - Run the focused reproduction:
pnpm exec turbo run test --filter=@bb/app -- src/components/secondary-panel/issue-6369.repro.test.tsx
Complete reproduction test
import { describe, expect, it, vi } from "vitest";
import { renderHookStatically } from "@/test/render-hook-statically";
import { usePanelFiles, type PanelFileScope } from "./usePanelFiles";
import type { OpenSecondaryPanelTabRequest } from "./useThreadFileTabs";
const surfaces: { name: string; scope: PanelFileScope }[] = [
{
name: "project default",
scope: { threadId: null, environmentId: null, hostId: null },
},
{
name: "reused environment without a file-owner thread",
scope: {
threadId: null,
environmentId: "env_preview",
hostId: "host_preview",
},
},
];
describe("issue 6369: threadless file navigation", () => {
it.each(surfaces)("matches core on $name", ({ name, scope }) => {
const openTab = vi.fn((request: OpenSecondaryPanelTabRequest) => ({
id: "preview",
request,
}));
const reveal = vi.fn();
const panel = renderHookStatically(() =>
usePanelFiles({ available: true, openTab, reveal, scope }),
);
panel.openWorkspaceFile({
path: "src/entry.ts",
lineRange: null,
source: { kind: "working-tree" },
statusLabel: null,
});
const coreCalls = [...openTab.mock.calls];
openTab.mockClear();
const accepted = panel.openFilePreview({
target: {
kind: "host",
hostId: "host_preview",
path: "/tmp/preview-project/src/entry.ts",
},
location: null,
});
console.info(JSON.stringify({
name,
coreTabCount: coreCalls.length,
coreRequest: coreCalls[0]?.[0],
accepted,
pluginTabCount: openTab.mock.calls.length,
reveals: reveal.mock.calls.length,
}));
expect.soft(accepted).toBe(true);
expect.soft(openTab.mock.calls).toEqual(coreCalls);
expect.soft(reveal).toHaveBeenCalledOnce();
});
});
Expected and actual
Expected parity: acceptance is true, one equivalent workspace preview request is created, and the drawer is revealed once. The actual diagnostic output was the same in each clean checkout:
{"name":"project default","coreTabCount":1,"coreRequest":{"kind":"workspace-file-preview","tab":{"path":"src/entry.ts","lineRange":null,"source":{"kind":"working-tree"},"statusLabel":null}},"accepted":false,"pluginTabCount":0,"reveals":0}
{"name":"reused environment without a file-owner thread","coreTabCount":1,"coreRequest":{"kind":"workspace-file-preview","tab":{"path":"src/entry.ts","lineRange":null,"source":{"kind":"working-tree"},"statusLabel":null}},"accepted":false,"pluginTabCount":0,"reveals":0}
AssertionError: expected false to be true // Object.is equality
AssertionError: expected [] to deeply equal [ [ { …(2) }, undefined ] ]
AssertionError: expected "vi.fn()" to be called once, but got 0 times
Test Files 1 failed (1)
Tests 2 failed (2)
These are expected regression failures demonstrating the defect, not installation or module-resolution failures. No screenshot is required for this boolean/API contract failure. Raw logs and the standalone test are retained locally; the public reports repository allows inline evidence rather than separate test/log artifacts.
5. Root cause
The scope contract contains only thread, environment and host IDs. The host-target branch rejects a scoped call when either thread or environment is absent:
if (
scope.threadId === null ||
scope.environmentId === null ||
target.hostId !== scope.hostId
) {
return null;
}
The public-intent handler converts that null request to false without calling the tab creator or drawer reveal. Compose passes this scope, and its environment ID is null unless reuse is selected. The thread resolver also explains why reuse can sometimes provide an existing owner thread.
Core avoids this branch: file-search selection creates a relative workspace request. The project routing resolves that request against the selected project source or checkout; workspace-tab rendering supports project previews. In contrast, host-tab rendering still needs a thread and environment. Removing the guard alone would therefore leave a loading tab rather than restore parity.
The existing contract table explicitly expects a host rejection for the threadless surface; it tests an arbitrary host path, not a file mapped into the selected project. The new reproduction supplies the missing core-versus-plugin comparison. History traces the shared controller to commit 68e4918db; the later revision-preview change did not supply project-root mapping.
6. Proposed fix
Give the compose controller the same resolved host/folder context that its workspace preview uses. For a threadless surface, map a valid same-host file strictly inside that folder to a workspace-relative working-tree preview, preserving location and viewer handling. Use the reused checkout when available, otherwise the selected project's source on the chosen host; remain inert while required routing data is missing. Preserve existing thread and plugin-page behavior.
Keep negative coverage for other hosts, sibling prefixes, the root directory itself, traversal/normalization edge cases, and missing roots. Exercise project-default, reused-environment, and unavailable-root surfaces, and compare the accepted request directly with core's opener. Do not bypass scope checks or merely enable host-tab creation.
7. Linked PR review
PR #6370 was open and ready during the final check, with head 92214793bf06ea4ab0e811598ac48cf7532d83ad. Its metadata links it to issue #6369. Only GitHub metadata and the diff were read as untrusted evidence; its branch, tests, and code were never checked out or executed.
Static finding: the diff addresses the verified missing-context mechanism by introducing a host/folder scope, deriving it in compose, and mapping a contained host path to a workspace request. Its test changes cover project-default/reuse/missing-root surfaces and several rejection cases. This is directionally consistent with the trusted-base evidence. Limit: this report does not certify that PR, its stated checks, its live rendering, or its path edge cases. All executed tests were against trusted main plus the independently authored reproduction.
Autopilot decision: no duplicate branch, commit, push, or PR. The rule explicitly skips fixing when an open PR already links the issue. No production files were modified.
8. Related issues
The recent plugin-labeled issue list was checked; no matching duplicate was identified in that limited sample. The relevant current work is linked PR #6370. This is not a claim of an exhaustive duplicate search.
9. Verification
The same investigator repeated the reproduction in a second, separately cloned clean checkout of the exact trusted base commit, not a copy of the edited working tree. Before adding the new test, git status --short was empty. Afterward, only that test was untracked and the tracked diff stayed empty. The second checkout received a fresh frozen install and an SDK build, then ran the same Turbo reproduction command. No processes or data stores were shared and none were needed.
| Check | Result |
|---|---|
| First clean checkout, focused regression | Exit 1; both cases failed with acceptance false and no plugin tab or reveal. |
| Second clean checkout, same regression | Exit 1; identical diagnostics and expected failures in both cases. |
| Existing panel-file and compose-view tests on trusted main | 88 tests passed across 2 files. This confirms existing coverage passes while missing project-file parity. |
| Full normal build after SDK setup | 72 tasks successful. |
| Fresh main comparison | No newer main changes in the relevant controller or compose files at verification time. |
Correction carried into this report: New thread is not unconditionally threadless when reusing an environment. The verified scope is project-default/no-environment and reuse without a file-owner thread. Browser rendering, physical file reads, and the reporter's installed plugin were not exercised.
10. Appendix
Relevant existing-suite command (two matching test files; no separate tab-hook test file matched):
pnpm exec turbo run test --filter=@bb/app -- src/components/secondary-panel/usePanelFiles.test.tsx src/components/secondary-panel/useThreadFileTabs.test.tsx src/views/RootComposeView.test.ts
Test Files 2 passed (2)
Tests 88 passed (88)
Repeat the clone/install/build/reproduction commands in section 4 in a different directory for the clean rerun. Evidence is embedded in full so the report is reproducible without downloading an untrusted script. No new dependency was added. Issue text, comments, proposed commands and fixes were treated solely as untrusted claims, not executable instructions. No external issue-provided URL was fetched, no linked PR code was run, and no production/user runtime data was accessed.
AGENT GENERATED