You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Directory picker appends forward slash to Windows paths on complete/suggest #54663
On Windows, completed or suggested directory paths in the web directory picker use a forward slash as the trailing separator: C:\repo\apex/. Split out from #54626 (server start directory is correct there; this is display-only).
Version
v2.0.26 dev (707de58), web dev build + serve backend on Windows 10.
Steps
serve from any directory, open the web UI, click Add project.
Type a partial directory path, e.g. C:\Users\boyanzh\Desktop\Programs\repos\opencode-pristine\packages, press Tab.
Observe the input box and the suggestion list.
Expected
C:\...\packages\ (native separator), suggestions like C:\...\ai\.
Actual
Input becomes C:\...\packages/; suggestions show C:\...\ai/, C:\...\app/, etc.
Root cause
packages/app/src/workspaces/selection/dialog.tsx: complete() appends a hardcoded "/", the suggestion rows render {suggestion.type === "directory" ? "/" : ""}, and the input comparison only strips trailing /. displayPickerPath itself already returns \ for drive paths — only the appended/stripped separators are wrong.
Thanks for the detailed report and the root-cause analysis. I could reproduce this on the latest dev (707de58), the same commit you built.
I couldn't run the web UI on Windows here. Instead, the test below runs the real displayPickerPath on C:/... paths and adds the trailing separator the same way dialog.tsx does (that part is copied into the test):
Completing ...\opencode\packages gives C:\...\opencode\packages/ instead of ...\packages\.
The directory suggestion row for ai shows C:\...\packages\ai/ instead of ...\ai\.
displayPickerPath already returns backslashes for drive paths. The / comes from the hardcoded separator in complete() and in the suggestion rows of packages/app/src/workspaces/selection/dialog.tsx, as you described. Your PR #54630 targets exactly this. #54626 is the related report about where the picker starts.
Reproduction script (picker-separator.test.ts)
// Reproduces #54663 against the real picker domain helpers, mirroring the exact// separator logic of packages/app/src/workspaces/selection/dialog.tsx.// Run from the repo root: bun test /workspace/repro/picker-separator.test.ts// (REPO env var can point at another checkout; default /workspace/repo)import{expect,test}from"bun:test"constrepo=process.env.REPO??"/workspace/repo"const{ displayPickerPath }=awaitimport(`${repo}/packages/app/src/workspaces/selection/domain.ts`)consthome="C:/Users/boyanzh"constinput="C:\\Users\\boyanzh\\Desktop\\repos\\opencode\\packages"// dialog.tsx complete(): setInput(match.type === "directory" && !value.endsWith("/") ? value + "/" : value)functioncompleted(absolute: string){constvalue=displayPickerPath(absolute,input,home)return!value.endsWith("/") ? value+"/" : value}// dialog.tsx suggestion row: {displayPickerPath(...)}{suggestion.type === "directory" ? "/" : ""}functionsuggestionRow(absolute: string){returndisplayPickerPath(absolute,input,home)+"/"}test("tab-completing a Windows directory uses a native trailing separator",()=>{constresult=completed("C:/Users/boyanzh/Desktop/repos/opencode/packages")console.log("completed input:",result)expect(result).toBe("C:\\Users\\boyanzh\\Desktop\\repos\\opencode\\packages\\")})test("Windows directory suggestion rows use a native trailing separator",()=>{constrow=suggestionRow("C:/Users/boyanzh/Desktop/repos/opencode/packages/ai")console.log("suggestion row:",row)expect(row).toBe("C:\\Users\\boyanzh\\Desktop\\repos\\opencode\\packages\\ai\\")})
Activity
opencode-agent commentedon Oct 12, 2026
Thanks for the detailed report and the root-cause analysis. I could reproduce this on the latest
dev(707de58), the same commit you built.I couldn't run the web UI on Windows here. Instead, the test below runs the real
displayPickerPathonC:/...paths and adds the trailing separator the same waydialog.tsxdoes (that part is copied into the test):...\opencode\packagesgivesC:\...\opencode\packages/instead of...\packages\.aishowsC:\...\packages\ai/instead of...\ai\.displayPickerPathalready returns backslashes for drive paths. The/comes from the hardcoded separator incomplete()and in the suggestion rows ofpackages/app/src/workspaces/selection/dialog.tsx, as you described. Your PR #54630 targets exactly this. #54626 is the related report about where the picker starts.Reproduction script (picker-separator.test.ts)
Run it:
bun picker-separator.test.ts