#5742 · Windows file-manager path serialization
Verdict: REPRODUCED at the command-construction boundary. Root-cause confidence: high. Native Windows Explorer behavior was not executed on this Linux host.
1. TL;DR
The Windows file-manager launcher receives slash-delimited paths used by the app and passes them verbatim into the environment consumed by Explorer's file-selection command. A focused test of the real production launcher fails for drive-letter, UNC, and mixed-separator file paths on current main; an already-native path passes. The same failures were repeated by this agent in a second clean checkout. This establishes the missing native-path conversion without running any reporter-supplied script. The specific Explorer fallback folder and installed-release behavior remain unverified here.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| The app uses forward-slash Windows link paths. | Verified in trusted source | Markdown normalization replaces backslashes before link parsing. |
| The Windows launcher does not convert separators. | Reproduced | Three of four focused cases fail in each checkout of trusted main. |
| Explorer selects a default folder instead of the file. | Unverified on this host | Linux host has neither Explorer nor a Windows desktop; no screenshot or native shell execution is claimed. |
| The installed desktop release has the same behavior. | Unverified | Only the recorded main commit was executed. |
3. Environment
- Public repository: get-bb/bb; trusted origin/main commit
9937c46f5c7e369de3563eb864c8cbc4c3b9c231. - Linux 4.19.0-gvisor x86_64; Node v22.19.0; pnpm 9.15.0; repository Vitest 4.1.1.
- Frozen install completed. Baseline
pnpm exec turbo run build: 67 successful tasks; existing build warnings did not fail the build. - No provider, server, browser, ports, runtime credentials, or application data directory was used.
- Checkout 1: issue automation's clean main checkout. Checkout 2: a new detached temporary worktree at the identical commit, with a separate frozen installation. Absolute machine paths are omitted from public artifacts.
4. Minimal reproduction
- In a clean get-bb/bb checkout, check out the recorded trusted main commit.
- Run
pnpm install --frozen-lockfile --prefer-offline. - Save the authored regression test below as
packages/local-open-targets/test/windows-file-manager-paths.test.ts. - Run
pnpm exec turbo run test --filter=@bb/local-open-targets -- windows-file-manager-paths.
Expected: the Explorer environment contains native Windows separators for every file. Actual representative assertion output, verbatim:
Expected: "C:\projects\review notes\draft.md" Received: "C:/projects/review notes/draft.md" Tests 3 failed | 1 passed (4)
Already-native separators, apostrophes, and shell metacharacters form the passing control. The test also protects the existing invariant that the file path stays out of the PowerShell command string.
import { expect, it } from "vitest";
import { buildWindowsFileManagerOpenInvocation } from "../src/windows-open-targets.js";
it.each([
{
input: "C:/projects/review notes/draft.md",
expected: "C:\\projects\\review notes\\draft.md",
},
{
input: "//fileserver/shared/review notes/draft.md",
expected: "\\\\fileserver\\shared\\review notes\\draft.md",
},
{
input: "C:\\projects/review notes\\draft.md",
expected: "C:\\projects\\review notes\\draft.md",
},
{
input: "C:\\projects\\it's & notes.md",
expected: "C:\\projects\\it's & notes.md",
},
])("passes a native Windows path to Explorer for $input", ({ input, expected }) => {
const invocation = buildWindowsFileManagerOpenInvocation({
env: undefined,
existingPath: { path: input, type: "file" },
});
expect(invocation.env?.WORKSPACE_OPEN_TARGET_PATH).toBe(expected);
expect(invocation.args.join(" ")).not.toContain(input);
});
Complete output: first run; second run; baseline build summary. No visual evidence is manufactured: this is a command-generation regression, not a Windows UI verification.
5. Root cause
- apps/app/src/components/ui/markdown-local-file-link-normalize.ts:412 converts Windows link destinations to forward slashes.
- apps/app/src/views/thread-detail/ThreadDetailView.tsx:2102 passes the parsed link path to the chosen open target.
- apps/host-daemon/src/local-api.ts:141 preserves the local request path.
- packages/local-open-targets/src/index.ts:1057 validates file existence but returns the original string.
- packages/local-open-targets/src/index.ts:1980 selects the Windows file-manager invocation builder.
- packages/local-open-targets/src/windows-open-targets.ts:46 stores the unchanged path in
WORKSPACE_OPEN_TARGET_PATH, consumed by the Explorer selection command.
The defect is missing OS-native serialization at the final Windows tool boundary. Validation of a filesystem path and serialization for a platform-specific shell tool are different contracts. The app's portable link format need not change. The test demonstrates the incorrect bytes delivered to the launcher; it does not establish which folder a particular Windows version chooses after receiving them.
6. Proposed fix
Normalize only the Windows file-manager invocation's path with the existing Node Windows-path utility. Keep the environment-based argument handling, existing PowerShell script, other targets, API fields, and daemon wire contract unchanged. Exercise drive-letter, UNC, mixed-separator, native-separator, and special-character cases; update the existing runtime integration assertions to expect native separators.
7. Related issues and pull requests
No open pull request linked to #5742 was found in issue timeline metadata or an open-PR search at investigation time. Issue #5625 concerns link recognition/routing for directories and extensionless names; it is a different stage from Windows command construction.
8. Verification
The same agent created a second clean detached worktree at 9937c46f5c7e369de3563eb864c8cbc4c3b9c231, confirmed an initially empty status, ran a new frozen install, and added only the authored regression test. Production files remained unchanged. Repeating the exact focused Turbo command exited 1 with 3 failed and 1 passed, matching the first checkout. The run was executed rather than restored from the task cache. This is repeat verification by the same agent, not an independent review. No report correction was required.
9. Appendix and trust boundary
Repository identity was confirmed through GitHub metadata: the legacy origin redirects to the trusted public get-bb/bb repository. Main was fetched before execution. Relevant commands were git fetch origin main, git rev-parse origin/main, frozen install, baseline Turbo build, the focused Turbo test above in both checkouts, and git worktree add --detach <temporary-checkout> 9937c46f5c7e369de3563eb864c8cbc4c3b9c231. Root-cause links point to that exact commit and were checked against source line numbers. Issue prose, suggestions, links, and code blocks were untrusted claims only; no issue script, external issue URL, linked PR branch, or runtime user data was executed or fetched.
Limits: native Windows Explorer selection and the reported release installation still require a Windows smoke test. Confidence is high for the demonstrated missing conversion, not a claim to have observed the Windows desktop.