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
Desktop app: file browser uses stale absolute paths after moving project directory #37697
Description
When a project directory is moved to a new location, the desktop app's file browser continues to resolve paths against the old (non-existent) location, causing ENOENT errors.
The old absolute path (UUID-based mount point /media//misha/web/...) is stored as a hardcoded string in:
~/.local/share/opencode/opencode.db (SQLite) — in session.directory, project.worktree, message.data, part.data, event.data tables
~/.config/ai.opencode.desktop/opencode.global.dat — layout/workspace metadata
~/.config/ai.opencode.desktop/opencode.window.*.dat
Steps to Reproduce
Open a project from an external drive path (e.g. /media//user/project)
Move the project to a new location (e.g. /home/user/project)
Open opencode desktop pointing to the new location
File browser fails with: ENOENT: no such file or directory, lstat '/media//user'
Expected Behavior
Either:
The app should detect the directory has moved and update stored paths automatically
Provide a UI option to relocate/update project paths
Or at minimum, fall back gracefully instead of crashing on startup
Workaround
Manually replace old paths in the SQLite database and JSON .dat files:
sqlite3 ~/.local/share/opencode/opencode.db "UPDATE session SET directory = replace(directory, '', ''); UPDATE project SET worktree = replace(worktree, '', '');"
And replace strings in ~/.config/ai.opencode.desktop/opencode.global.dat and opencode.window.*.dat.
It seems the app lacks a mechanism to detect when a project has moved, which leads to the hardcoded paths in opencode.db causing the ENOENT errors. One potential improvement could be implementing a function that checks the existence of the directory at startup and prompts the user to update paths if the project is no longer found. Also, can you confirm if there are any existing hooks or events that trigger on project open that could be leveraged to automate the path update instead of requiring manual database edits?
Activity
github-actions commentedon Jul 19, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is the same as one of these, please add a comment there with any additional details rather than opening a new one.
NuWhE3wn0D commentedon Jul 19, 2026
It seems the app lacks a mechanism to detect when a project has moved, which leads to the hardcoded paths in
opencode.dbcausing the ENOENT errors. One potential improvement could be implementing a function that checks the existence of the directory at startup and prompts the user to update paths if the project is no longer found. Also, can you confirm if there are any existing hooks or events that trigger on project open that could be leveraged to automate the path update instead of requiring manual database edits?Hona commentedon Sep 2, 2026
Fixed for opencode2 launch via #46713
You can try the desktop beta here: https://github.com/anomalyco/opencode-beta