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
Windows: TUI silently starts in $HOME when cwd is on a mapped drive whose share root is unreadable (realPath EPERM) #63307
Control: opencode session list works from M: (\FILESRV\Public, readable share root)
opencode session list fails from Z: and also from W: mapped deeper (W: -> \FILESRV\HomeShare\username\work, project W:\repos\sample-project), i.e. the failure follows the share, not the path depth
Starting from a sibling project on the same drive (Z:\work\repos\other-project) fails the same way
Expected
The requested location should be used; a PermissionDenied from realPath should be treated like NotFound (non-fatal), at minimum when establishing the startup location
Thanks for the detailed report and the diagnostics you already ran. I can't reproduce this in our sandbox: it needs Windows with an SMB share whose root you can't read, mapped to a drive letter, and the sandbox only runs Linux. So this needs a maintainer with a Windows setup.
From the code: when OpenCode opens a directory, it calls realPath on it and treats a permission-denied error as fatal. That logic is the same in 2.2.1 and 2.2.7, so the change you're seeing probably comes from how realPath itself works on Windows in 2.2.7. One possible cause, not yet confirmed, is a dependency upgrade (#60651). It may have made realPath check the share root above your mapped folder, which you can't read.
Same silent fallback on macOS, so adding a data point — this isn't Windows-specific.
Environment
opencode 2.3.0, macOS 15.5 (24F74), arm64
TUI launched from the VS Code integrated terminal (TERM_PROGRAM=vscode) in ~/Desktop/dev/<project>
The OpenCode desktop app was also running, so the TUI connected to its shared service: .../ai.opencode.desktop/cli/2.3.0-arm64/opencode-cli serve --service, whose parent is /Applications/OpenCode.app/Contents/MacOS/OpenCode
Actual behavior
Typing @ in the prompt lists my home-directory files instead of the project files.
GET /api/debug/location returns [{"directory":"/Users/me"}, ...]; the project location never appears.
GET /api/fs/list for the launch directory returns 500 (198 times between 11:52 and 12:11 UTC):
No error is shown in the TUI. The session is created with directory=/Users/me, so it starts in $HOME.
Cause in my case
The folder is under ~/Desktop, which macOS protects with TCC. The shared server is a child of OpenCode.app, so it inherits that app's privacy grants, and this folder was never granted. The TUI process itself has cwd set to the project and its terminal can read it; only the server can't.
Impact
Same as the report, different trigger: location boot fails and the TUI silently continues in $HOME, so @ searches home instead of the project. It also doesn't recover later — every request for the project location keeps 500ing while the UI gives no indication that the launch directory was rejected.
Name the process/app that owns the service in that error, since access is granted per responsible app for a shared service.
Offer --standalone (or a server per location) at the point of failure, because a private server inherits the terminal's permissions.
Confirmed workaround: running the TUI with opencode --standalone from the same project works — the private server inherits the terminal's permissions and reads the folder. Granting the desktop app Full Disk Access and restarting the service is the alternative for keeping the shared service.
Activity
opencodejr commentedon Nov 11, 2026
Thanks for the detailed report and the diagnostics you already ran. I can't reproduce this in our sandbox: it needs Windows with an SMB share whose root you can't read, mapped to a drive letter, and the sandbox only runs Linux. So this needs a maintainer with a Windows setup.
From the code: when OpenCode opens a directory, it calls
realPathon it and treats a permission-denied error as fatal. That logic is the same in 2.2.1 and 2.2.7, so the change you're seeing probably comes from howrealPathitself works on Windows in 2.2.7. One possible cause, not yet confirmed, is a dependency upgrade (#60651). It may have maderealPathcheck the share root above your mapped folder, which you can't read.Related issues, most relevant first:
C:\drive root makes realpath fail with EPERM, with a proposed switch to the native realpathEUNKNOWNon WinFsp virtual drives, causing 500sEmmanuel-Develops commentedon Nov 13, 2026
Same silent fallback on macOS, so adding a data point — this isn't Windows-specific.
Environment
TERM_PROGRAM=vscode) in~/Desktop/dev/<project>.../ai.opencode.desktop/cli/2.3.0-arm64/opencode-cli serve --service, whose parent is/Applications/OpenCode.app/Contents/MacOS/OpenCodeActual behavior
@in the prompt lists my home-directory files instead of the project files.GET /api/debug/locationreturns[{"directory":"/Users/me"}, ...]; the project location never appears.GET /api/fs/listfor the launch directory returns 500 (198 times between 11:52 and 12:11 UTC):directory=/Users/me, so it starts in$HOME.Cause in my case
The folder is under
~/Desktop, which macOS protects with TCC. The shared server is a child ofOpenCode.app, so it inherits that app's privacy grants, and this folder was never granted. The TUI process itself hascwdset to the project and its terminal can read it; only the server can't.Impact
Same as the report, different trigger: location boot fails and the TUI silently continues in
$HOME, so@searches home instead of the project. It also doesn't recover later — every request for the project location keeps 500ing while the UI gives no indication that the launch directory was rejected.Suggestions
fs/list.--standalone(or a server per location) at the point of failure, because a private server inherits the terminal's permissions.Confirmed workaround: running the TUI with
opencode --standalonefrom the same project works — the private server inherits the terminal's permissions and reads the folder. Granting the desktop app Full Disk Access and restarting the service is the alternative for keeping the shared service.