Skip to content

Workspace path is not updated after moving/cloning the same Git repository #36150

Closed

Description

@Vyran1

Environment
OpenCode Desktop: v1.17.18
OS: Windows 11
Steps to reproduce
Clone a repository to:
C:\Users\User\Documents\ZaryxStudio\ZaryxDocs\ZaryxDocs
Open it in OpenCode Desktop.
Close OpenCode.
Delete that directory completely.
Clone the same Git repository to a different location:
C:\Users\User\Documents\Proyectos\ZaryxDocs
Open the repository from the new location.
Expected behavior
OpenCode should recognize the repository's new location.
The project entry in the sidebar should point to the new path.
Switching between projects should continue using the active workspace.
Actual behavior
OpenCode still displays the old path:
~\Documents\ZaryxStudio\ZaryxDocs\ZaryxDocs

even though that directory no longer exists.

Additional issues:

The main chat/session works correctly when the project is initially opened.
However, if I click the project again from the sidebar, OpenCode switches back to the deleted path.
The session disappears.
The assistant no longer responds.
The default OpenCode error sound plays.
The project becomes unusable until it is reopened manually.
What I already checked
Deleted the original directory completely.
Confirmed the repository only exists in the new location.
Inspected all opencode.workspace.*.dat files.
All workspace files contain the correct path.
Searched the entire ai.opencode.desktop configuration directory for the old path and found no references.
Global configuration only contains MCP settings.
Suspected cause

It appears OpenCode Desktop caches the workspace location internally (possibly using a repository identifier or in-memory state) and does not invalidate or refresh it after the repository is moved. As a result, selecting the project from the sidebar restores a stale path that no longer exists, breaking the associated session.

Activity

  1. github-actions commented on Jul 9, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The umbrella tracking issue for this class of stale-path / cross-project data bugs is #35890.

  2. TheMikeyRoss commented on Jul 14, 2026

    @TheMikeyRoss

    I'm having the same issue.

    Steps to reproduce:

    1. create a folder in C:\\oldpath\project1
    2. use opencode in that project1 (for me i used to use the terminal) and have a back and forth with an agent like you normally would
    3. move project1 folder into another directory for example C:\\newpath\project1
    4. in opencode desktop, open a new project and select the directory C:\\newpath\project1
    5. opencode will show C:\\oldpath\project1 and the agent wont work

    I'm on Windows 10 using OpenCode Desktop v1.17.20

  3. Hona commented on Sep 2, 2026

    @Hona
    Member

    Fixed for opencode2 launch via #46713
    You can try the desktop beta here: https://github.com/anomalyco/opencode-beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions