Skip to content

Desktop workspace path stays stuck on old absolute path after folder rename #31869

Closed as not planned

Description

@Sid-1996

Description

Summary

On Windows, OpenCode Desktop keeps using an old workspace path after the project folder is renamed.

I renamed my project from:

C:\Code play first\AetherGazer ahk

to:

C:\Code play first\AetherGazer-SemiAuto-AHK

but OpenCode continued to reference the old path.

What I checked

I first checked the main config files:

  • C:\Users\user\.config\opencode\opencode.jsonc
  • C:\Users\user\AppData\Roaming\ai.opencode.desktop\default.dat

Those did not contain the stale project path.

The stale workspace state was instead stored in workspace cache files under:

  • C:\Users\user\AppData\Roaming\ai.opencode.desktop\opencode.workspace.QzpcQ29kZSBw*.dat

What I observed

The old path appeared to be preserved in workspace cache state even after the folder had been renamed.

After removing the stale workspace cache files, OpenCode regenerated workspace state and stopped reusing the old path.

Steps to reproduce

  1. Open a workspace in OpenCode Desktop on Windows.
  2. Rename the project folder on disk.
  3. Reopen OpenCode Desktop.
  4. OpenCode may still reference the old absolute path instead of the renamed folder.

Expected behavior

When a workspace folder is renamed, OpenCode should:

  • detect that the previous absolute path no longer exists
  • rebind the workspace to the new path
  • or clear stale workspace records automatically

Actual behavior

OpenCode continues to reuse old path-encoded workspace cache entries and keeps pointing at the previous folder name.

Suggested fix

Possible improvements:

  • detect missing workspace paths and refresh them
  • avoid persisting stale path-encoded workspace records after rename
  • provide a way to clear stale workspace cache for a specific project
  • make workspace state resilient to folder renames on Windows

Environment

  • OS: Windows
  • OpenCode Desktop
  • Workspace path rename scenario

Plugins

OpenCode Desktop

OpenCode version

1.16.2

Steps to reproduce

  1. Open OpenCode Desktop on Windows.
  2. Open a workspace folder.
  3. Rename the project folder on disk.
  4. Reopen OpenCode.
  5. OpenCode still keeps referencing the old absolute path instead of the renamed folder.

Screenshot and/or share link

No share link available.

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. github-actions commented on Jun 11, 2026

    @github-actions
    Contributor

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

    The root cause described (stale workspace cache entries persisting after a folder rename/move) appears to be the same underlying issue reported in those tickets. Please review them and consider whether this is a new scenario or can be tracked there.

  2. Sid-1996 commented on Jun 11, 2026

    @Sid-1996
    Author

    Thanks. I confirmed this is the same stale workspace/project-root issue.

    After closing the workspace and reopening a new project directory, OpenCode now behaves normally on my machine. Before that, even opening a new project would sometimes jump back to the old path.

    Please feel free to close this issue and track it under the duplicate/root issue instead.

  3. github-actions commented on Aug 11, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  4. 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