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
opencode web on Windows resolves working directory to drive root instead of CWD #26966
On Windows, when running opencode web from a directory (e.g. C:\Users\Sakura), the backend server resolves the working directory to the drive root (C:) instead of the actual current working directory. This causes the agent to be unable to access project files and incorrectly sets Working directory: C:.
Notably, the TUI mode (opencode without arguments) does not have this issue — it correctly picks up the current working directory. The bug is specific to opencode web mode.
Expected behavior:
opencode web should use the current working directory where the command was launched, same as the TUI mode does.
Plugins
Non
OpenCode version
1.14.41
Steps to reproduce
On Windows, open a terminal (PowerShell & CMD).
Navigate to a directory: cd C:\Users\Sakura
Run opencode web
Open the web interface at the displayed URL and check the working directory in the session — it will show C:\ instead of C:\Users\Sakura.
For comparison, run opencode (TUI mode) from the same directory — the working directory is correctly C:\Users\Sakura.
Same issue on Linux (Docker container). The server is started via opencode web --hostname 0.0.0.0 --port 8080 from /home/ubuntu/workspace (confirmed via working_dir, WORKDIR, and cd ... && exec in CMD), but agent sessions spawn with cwd=/:
This has two additional consequences beyond the incorrect working directory display:
Project-level skills in .opencode/skills/<name>/SKILL.md are not discovered — OpenCode walks up from CWD to find them, but since CWD is /, they're never found. Only global ~/.config/opencode/skills/ works. Workaround: symlink ~/.config/opencode/skills → /path/to/project/.opencode/skills.
"Create Git repository" button always shown in the web UI — because /.git doesn't exist, even though /home/ubuntu/workspace/.git is a valid git repo.
The OPENCODE_PROJECT_ROOT=/home/ubuntu/workspace environment variable is set but appears to be unused by the server for CWD resolution. A --dir flag (as proposed in #31473) or respecting OPENCODE_PROJECT_ROOT would resolve all three symptoms.
Tested on OpenCode 1.17.11, Ubuntu 26.04 container (Docker Desktop on Windows 11 25H2 Professional host).
Activity
github-actions commentedon May 12, 2026
This issue might be a duplicate of existing issues. Please check:
opencode serve/webon Windows resolving to root directory (instead of CWD), with skills not found/in web/desktop mode instead of project CWD) — closed but may be relatedIf your issue is distinct from the above, feel free to add details clarifying the difference.
francesco-arca commentedon Jun 25, 2026
Same issue on Linux (Docker container). The server is started via
opencode web --hostname 0.0.0.0 --port 8080from/home/ubuntu/workspace(confirmed viaworking_dir,WORKDIR, andcd ... && execin CMD), but agent sessions spawn withcwd=/:This has two additional consequences beyond the incorrect working directory display:
Project-level skills in
.opencode/skills/<name>/SKILL.mdare not discovered — OpenCode walks up from CWD to find them, but since CWD is/, they're never found. Only global~/.config/opencode/skills/works. Workaround: symlink~/.config/opencode/skills→/path/to/project/.opencode/skills."Create Git repository" button always shown in the web UI — because
/.gitdoesn't exist, even though/home/ubuntu/workspace/.gitis a valid git repo.The
OPENCODE_PROJECT_ROOT=/home/ubuntu/workspaceenvironment variable is set but appears to be unused by the server for CWD resolution. A--dirflag (as proposed in #31473) or respectingOPENCODE_PROJECT_ROOTwould resolve all three symptoms.Tested on OpenCode 1.17.11, Ubuntu 26.04 container (Docker Desktop on Windows 11 25H2 Professional host).
github-actions commentedon Aug 25, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.