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
Regression: moved Git project keeps stale worktree path in server/web on 1.18.34 #52719
After moving a Git repository and opening it from its new location in the server/web UI, OpenCode recognizes the new directory but keeps the deleted original path as the project worktree. New sessions briefly show thinking, then abort without a visible error because prompt initialization resolves the stale path.
This appears to be a regression of #30005, which was closed as fixed for the OpenCode 2 launch via #46713.
Environment
OpenCode: 1.18.34
OS: Linux
Mode: opencode serve with web UI
Server command: opencode serve --hostname 0.0.0.0 --port 4096
State database: ~/.local/share/opencode/opencode.db
Steps to reproduce
Open a Git repository at /home/user/repo.
Move it to /home/user/projects/repo.
Open/add /home/user/projects/repo in the server/web UI.
Create a new session and send a message.
Expected behavior
OpenCode updates the canonical project worktree and creates the session with /home/user/projects/repo. The prompt runs normally.
Actual behavior
OpenCode associates the new directory with the existing Git project ID, but keeps the old path in project.worktree. Sessions are then created with /home/user/repo. The UI shows thinking briefly and silently stops.
message=created ... directory=/home/user/repo
message=loop ... step=0
message=stream ... agent=title
message="prompt_async failed" ...
PlatformError: NotFound: FileSystem.realPath (/home/user/repo)
Error: ENOENT: no such file or directory
Restarting the server does not help because the stale canonical path is persisted in SQLite. Removing/re-adding the project in the UI also selects the existing Git project record.
Workaround
After backing up the database, updating both project.worktree and affected session.directory values to the new path restores operation. PRAGMA integrity_check returns ok.
Additional UX issue
The web UI does not surface the prompt_async failed filesystem error. It only shows thinking for a moment and then returns to idle, which makes this failure difficult to diagnose.
In v2, when a project is opened from a new location and its previous directory no longer exists, the project's worktree is updated to the new path, and new sessions are created in the directory you selected; this has been in place since v2.0.0. Since v2.0.27, a prompt that fails also shows its error in the session instead of silently going back to idle. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.
Activity
github-actions commentedon Oct 2, 2026
This issue might be a duplicate of existing issues. Please check:
project.worktree, causingFileSystem.realPathfailures during prompts.project.worktreeat the deleted path, and re-adding it does not refresh it.prompt_asyncreportingFileSystem.realPath/ENOENT.neriousy commentedon Oct 19, 2026
In v2, when a project is opened from a new location and its previous directory no longer exists, the project's worktree is updated to the new path, and new sessions are created in the directory you selected; this has been in place since v2.0.0. Since v2.0.27, a prompt that fails also shows its error in the session instead of silently going back to idle. To get v2:
npm i -g @opencode/cli@latestorcurl -fsSL https://opencode.ai/v2/install | bash(desktop: update the app). If you still see this on v2, please open a new issue with the details.