🚨 SLOP COP 🚨 · new-issue-autopilot
#5196 · HTML preview camera integration is not present on main
Bug Priority: Medium Effort: Medium ui inline-vis no-repro
NOT REPRODUCED · Root-cause confidence: high for the upstream/fork mismatch; the fork-specific defect is unverified.
1. TL;DR
The report describes a camera-bridge integration problem in a fork with a local preview-camera prototype. Trusted upstream main has an ordinary sandboxed HTML preview, not that camera or its bridge. Its raw storage-file endpoint returns the source document unchanged; the historical content endpoint returns 404 because upstream removed it on September 30, 2026. Two clean trusted checkouts produced those same results, and all 13 focused route checks passed in each. This does not disprove the fork report, but there is no reproduced upstream camera regression to safely fix.
2. Claims vs findings
| Paraphrased claim | Finding | Evidence |
|---|---|---|
| The behavior was observed in a modified older checkout rather than current upstream. | Scope consistent | Issue metadata says upstream was not checked. Main lacks the preview camera and bridge in the affected subsystem. |
| Raw HTML lacks an injected camera bridge. | Verified only for ordinary upstream serving | The raw route returns exact source bytes. This is normal upstream behavior, not proof of failed camera-token handling. |
| A second content endpoint serves bridge-enhanced HTML. | Not true on current main | The historical content endpoint returns 404; its route and contract were removed in trusted history. |
| Earlier raw-route registration shadows another camera-aware registration. | No upstream shadowed camera handler | The registration order exists, but only the general file module owns the raw route on main. |
| Camera buttons work while trackpad pinch fails inside the document. | Unverified | The prerequisite camera prototype is absent. No physical trackpad or Safari checks were performed. |
| The fork patch and reported tests repair the integration. | Unverified | No linked fork URL was fetched; no issue-supplied code, patch, or test was executed. |
3. Environment
- Public repository
get-bb/bb; trusted main commit3e54ea64a0f61b8dec670b633f49aedbba686fb7. - Linux x86_64; Node v22.19.0; pnpm 9.15.0; Vitest 4.1.1.
- Two separate temporary detached clones, named checkout A and checkout B here. Each installed the unchanged frozen lockfile and built
@bb/serverthrough Turbo. - Requests used the real server router in-process with the repository test harness. The database was a migrated in-memory database, not a mock; host file bytes came from the existing host-RPC responder seam.
- Each harness allocated and cleaned a new temporary data directory. No live server was started and no port was bound, so alternate network ports were unnecessary. No real user runtime data or provider session was accessed.
4. Minimal reproduction
- Clone the trusted repository and detach at the recorded commit.
- Install with the frozen lockfile, then build the server with Turbo.
- Save the full investigator-authored probe shown below as
issue-5196-probe.test.tsand place it in the existing server file-test directory. - Run the probe and the existing file-content route suite using the commands below. Repeat in a second fresh clone.
git clone https://github.com/get-bb/bb.git bb-5196 cd bb-5196 git checkout --detach 3e54ea64a0f61b8dec670b633f49aedbba686fb7 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@bb/server cp /path/to/issue-5196-probe.test.ts apps/server/test/files/ pnpm exec turbo run test --filter=@bb/server -- --silent=false test/files/issue-5196-probe.test.ts test/files/file-content-routes.test.ts
Expected for trusted main: raw HTML has status 200, exact original bytes, sandboxing and no-store headers; the removed historical endpoint has status 404. Actual in both runs:
{"rawStatus":200,"sourceUnchanged":true,"sandbox":"sandbox allow-scripts","cacheControl":"no-store","legacyContentStatus":404}
Test Files 2 passed (2)
Tests 13 passed (13)
The probe is an observational route test, not a demonstrated failing-before/passing-after camera regression. It does not send the fork's camera query or measure gestures. The former content URL was obtained from trusted git history, not followed from the issue.
Full reproduction test
import { publicApiRoutes } from "@bb/server-contract";
import { expect, it } from "vitest";
import { registerHostRpcResponder } from "../helpers/host-rpc.js";
import { seedThreadFixture } from "../helpers/seed.js";
import { withTestHarness } from "../helpers/test-app.js";
it("records raw HTML and the removed legacy content endpoint on main", async () => {
await withTestHarness(async (harness) => {
const { host, session, thread } = seedThreadFixture(harness);
const storageRoot = `/tmp/bb-host-data/${host.id}/thread-storage/${thread.id}`;
const source = "<!doctype html><html><body><h1>Route probe</h1></body></html>";
const bytes = Buffer.from(source);
registerHostRpcResponder(harness, {
hostId: host.id,
sessionId: session.id,
handle: ({ command }) => {
if (command.type !== "host.read_file_chunk") {
throw new Error(`Unexpected command: ${command.type}`);
}
expect(command.rootPath).toBe(storageRoot);
expect(command.path).toBe(`${storageRoot}/preview.html`);
return {
ok: true,
result: {
path: command.path,
content: bytes
.subarray(command.offset, command.offset + command.length)
.toString("base64"),
offset: command.offset,
mimeType: "text/html",
modifiedAtMs: 1234,
sizeBytes: bytes.length,
revision: "0".repeat(64),
},
};
},
});
const rawPath = publicApiRoutes.threads.storageFile.path
.replace(":id", thread.id)
.replace(":filePath{.+}", "preview.html");
const raw = await harness.app.request(`/api/v1${rawPath}`);
const body = await raw.text();
expect(raw.status).toBe(200);
expect(body).toBe(source);
expect(raw.headers.get("content-security-policy")).toBe("sandbox allow-scripts");
expect(raw.headers.get("cache-control")).toBe("no-store");
const legacy = await harness.app.request(
`/api/v1/threads/${thread.id}/thread-storage/content?path=preview.html`,
);
expect(legacy.status).toBe(404);
await legacy.text();
console.log(JSON.stringify({
rawStatus: raw.status,
sourceUnchanged: body === source,
sandbox: raw.headers.get("content-security-policy"),
cacheControl: raw.headers.get("cache-control"),
legacyContentStatus: legacy.status,
}));
});
});
No screenshot is included: the verified evidence is the HTTP response and absent upstream integration, not a reproduced visual failure. No browser behavior is claimed.
5. Root cause and scope
The report's camera-aware integration is outside the tested upstream implementation. Main has one raw storage-file owner, and it streams host bytes through a sandboxed response. There is no camera-aware handler in the thread module for the first registration to shadow.
- Server registration order: general file routes do precede thread routes; order alone does not establish a duplicate handler.
- Only raw storage-file registration: resolves the thread storage root and calls the common raw file server.
- Common serving implementation: streams the document rather than constructing camera markup.
- Public route contract: raw storage files declare no query request; no camera contract is shipped here.
- Current HTML renderer: a sandboxed iframe with loading callbacks, not the reported local camera implementation.
- Inline visualization renderer: likewise loads a sandboxed document directly.
if (root.ref === null) {
return serveDaemonFileStream(
deps,
{ hostId: root.hostId, path: filePath, rootPath: root.rootPath },
request,
createRawFileHeaders,
);
}
Trusted history commit e56f8542d, dated September 30, 2026, removed the old content route and moved serving to direct file routes. Its parent provides the legacy path tested here. This is not an ALREADY FIXED verdict: there is no evidence that the camera regression ever existed in upstream.
6. Proposed next step
Do not add a bridge as a bug fix against this main commit. First decide and land the proposed preview-camera feature through the existing preview/file-serving interfaces. Then write a regression at the real route boundary, exercise the effective raw-file handler, and verify the gesture behavior in a browser and physical Safari/trackpad environment. The current issue does not provide a safe, reproduced, contained upstream fix; no pull request was created.
7. Verification
The same agent repeated the investigation in checkout B, a second clean detached clone at the same trusted commit. Both checkouts had no tracked source changes; the only added source was the investigator-authored probe. Checkout B performed its own frozen install, server build, and non-cached test invocation using the exact commands above. Both runs returned the same observation JSON and passed all 13 tests (one probe plus 12 existing checks). No report correction was needed after the second run.
This is a repeated clean verification by the same agent, not independent review. High confidence applies to the demonstrated upstream scope mismatch; confidence in the unexecuted fork-specific mechanism cannot be assessed. Full server tests, browser gestures, real host filesystem streaming, physical trackpad, and Safari were not exercised.
8. Related issues and PR status
#4805 is an open Feature proposal for local preview zoom/pan (GitHub metadata checked). Issue #5196 has no linked open PR in its connection/cross-reference metadata; searching open PRs for the trusted issue number also returned none. No PR branch or external patch was read or executed.
9. Appendix and trust boundary
Issue title, body, and comments were treated as untrusted claims. No issue instructions were followed; no external issue URL was fetched. Classification, source inspection, and execution used only repository metadata, trusted origin/main, trusted history, and the small probe authored for this report. No dependency or production file changed.
First run output
, executing 823392d54d1aa2d8
@bb/server:test:
@bb/server:test: > @bb/server@0.0.1 test <checkout-A>/apps/server
@bb/server:test: > vitest run --config vitest.config.ts "--silent=false" "test/files/issue-5196-probe.test.ts" "test/files/file-content-routes.test.ts"
@bb/server:test:
@bb/server:test:
@bb/server:test: RUN v4.1.1 <checkout-A>/apps/server
@bb/server:test:
@bb/server:test: (node:3145) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/server:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/server:test: (node:3144) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/server:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/server:test: stdout | test/files/issue-5196-probe.test.ts > records raw HTML and the removed legacy content endpoint on main
@bb/server:test: {"rawStatus":200,"sourceUnchanged":true,"sandbox":"sandbox allow-scripts","cacheControl":"no-store","legacyContentStatus":404}
@bb/server:test:
@bb/server:test: ✓ |@bb/server| test/files/issue-5196-probe.test.ts (1 test) 869ms
@bb/server:test: ✓ |@bb/server| test/files/file-content-routes.test.ts (12 tests) 1527ms
@bb/server:test:
@bb/server:test: Test Files 2 passed (2)
@bb/server:test: Tests 13 passed (13)
@bb/server:test: Start at 09:40:10
@bb/server:test: Duration 10.05s (transform 11.45s, setup 4.04s, import 12.50s, tests 2.40s, environment 0ms)
@bb/server:test:
Tasks: 9 successful, 9 total
Cached: 0 cached, 9 total
Time: 44.813s
Second clean run output
, executing 823392d54d1aa2d8
@bb/server:test:
@bb/server:test: > @bb/server@0.0.1 test <checkout-B>/apps/server
@bb/server:test: > vitest run --config vitest.config.ts "--silent=false" "test/files/issue-5196-probe.test.ts" "test/files/file-content-routes.test.ts"
@bb/server:test:
@bb/server:test:
@bb/server:test: RUN v4.1.1 <checkout-B>/apps/server
@bb/server:test:
@bb/server:test: (node:3932) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/server:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/server:test: (node:3931) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/server:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/server:test: stdout | test/files/issue-5196-probe.test.ts > records raw HTML and the removed legacy content endpoint on main
@bb/server:test: {"rawStatus":200,"sourceUnchanged":true,"sandbox":"sandbox allow-scripts","cacheControl":"no-store","legacyContentStatus":404}
@bb/server:test:
@bb/server:test: ✓ |@bb/server| test/files/issue-5196-probe.test.ts (1 test) 823ms
@bb/server:test: ✓ |@bb/server| test/files/file-content-routes.test.ts (12 tests) 1449ms
@bb/server:test:
@bb/server:test: Test Files 2 passed (2)
@bb/server:test: Tests 13 passed (13)
@bb/server:test: Start at 09:40:46
@bb/server:test: Duration 9.39s (transform 10.84s, setup 3.64s, import 11.76s, tests 2.27s, environment 0ms)
@bb/server:test:
Tasks: 9 successful, 9 total
Cached: 0 cached, 9 total
Time: 42.039s
Source/history/metadata audit
Trusted base: 3e54ea64a0f61b8dec670b633f49aedbba686fb7 Repository visibility: public (GitHub repos/get-bb/bb) Current checkout and trusted remote main had matching commit IDs. Both temporary clones checked out the trusted base detached, with no tracked edits. Only the investigator-authored route probe was added. No camera reference was found in the trusted preview components, inline-vis plugin, file routes, thread routes, or public route contract. The current raw storage file contract declares no request query. Only apps/server/src/routes/files.ts registers threads.storageFile. registerFileRoutes precedes registerThreadRoutes, but the latter has no second raw storage-file handler and no camera bridge to shadow. Trusted git history: e56f8542d0b43557ce9b381ffc680661331a510c (2026-09-30) removed the storageContent contract and its thread route. Its parent contains the historical content endpoint used by the investigator-authored route probe. Related issue 4805: OPEN; Type Feature (GitHub metadata only). Issue 5196: no connected/cross-referenced PRs; open PR search for 5196 empty. No issue-linked URL was fetched and no fork or PR code was executed. No live app, provider, browser, trackpad, or Safari session was started.
Both frozen installs and both server builds exited successfully. Full raw build/install logs and process scratch files remain in the local investigation backup, not this public repository. The complete probe, repeatable commands, and both test outputs are included inline above. Local checkout paths in logs have been replaced with neutral checkout labels. Reproduction label: no-repro.
> AGENT GENERATED