Skip to content

copied project folder permanently inherits original's workspace state #35297

Closed

Description

@adsd2004

Description

OpenCode desktop app misidentifies the opened project directory as another (sibling) project, and keeps restoring the wrong workspace on every launch.

I copied D:\_Programming\WEB-Tools\Electron_OpenProject to D:\_Programming\WEB-Tools\Electron_MailPlug to start a new project. When I open Electron_MailPlug in the desktop app, it is recognized and displayed as Electron_OpenProject — the original folder it was copied from. Closing the project, fully quitting the app, and reopening MailPlug does not help; the app keeps reopening the OpenProject workspace (icon color, sessions, prompt history, etc.).

Root cause: the workspace identifier key is derived from only the first ~10–14 characters of the folder path, not from the full path or a hash of it. All sibling folders under D:\_Programming\WEB-Tools\ collide into the same workspace key.

Two encoding schemes observed in %APPDATA%\ai.opencode.desktop\:

  • opencode.workspace.D--_Programm.<randomId>.dat — path prefix D:\_Programm (14 chars, : and \ replaced with -)
  • opencode.workspace.RDpcX1Byb2dy.<randomId>.dat — base64 of D:\_Progr (10 chars)

Both prefixes are shared by Electron_OpenProject, Electron_MailPlug, and any other sibling folder. On top of that, opencode.global.dat stores server.lastProject.local = D:\_Programming\WEB-Tools\Electron_OpenProject, so even after deleting every opencode.workspace.*.dat file, the app reads lastProject on startup and reopens the wrong project, regenerating the workspace files.

Expected: each distinct full directory path maps to its own workspace; copying a folder should not inherit the original's workspace identity.

Plugins

@tarquinen/opencode-dcp, @franlol/opencode-md-table-formatter@latest, superpowers@git+https://github.com/obra/superpowers.git

OpenCode version

1.17.13 (desktop app, Electron build)

Steps to reproduce

  1. Have an existing project at D:\_Programming\WEB-Tools\Electron_OpenProject and open it at least once in the OpenCode desktop app so workspace state is created.
  2. Copy that folder to a sibling path, e.g. D:\_Programming\WEB-Tools\Electron_MailPlug.
  3. In the desktop app: File → Open Project → select Electron_MailPlug.
  4. Observe the app loads the Electron_OpenProject workspace (wrong icon color, sessions, prompt history).
  5. Close the project and fully quit the app.
  6. Delete every opencode.workspace.*.dat under %APPDATA%\ai.opencode.desktop\.
  7. Relaunch the app and open Electron_MailPlug again — it still reopens as Electron_OpenProject, because opencode.global.dat → server.lastProject.local still points at the old path and the workspace key prefix collision recreates the same workspace files.

Actual result: the copied folder is never treated as a new, independent workspace.

Expected result: the copied folder gets its own workspace key derived from the full path, so it opens as Electron_MailPlug with a clean state.

Screenshot and/or share link

Workspace key collision evidence — two different encoding schemes, both truncated to the same path prefix:

%APPDATA%\ai.opencode.desktop\
  opencode.workspace.D--_Programm.10tz19z.dat   # "D:\_Programm" (14 chars)
  opencode.workspace.D--_Programm.13iacx.dat
  opencode.workspace.D--_Programm.1inq7oi.dat
  ... (13 files, all share the same D--_Programm prefix)
  opencode.workspace.RDpcX1Byb2dy.106zhi.dat    # base64("D:\_Progr") (10 chars)
  opencode.workspace.RDpcX1Byb2dy.149qp08.dat
  ... (14 files, all share the same RDpcX1Byb2dy prefix)

opencode.global.dat → server key:

"server": "{\"list\":[],\"projects\":{\"local\":[]},\"lastProject\":{\"local\":\"D:\\\\_Programming\\\\WEB-Tools\\\\Electron_OpenProject\"}}"

All sibling folders under D:\_Programming\WEB-Tools\ (Electron_OpenProject, Electron_MailPlug, Electron_Planka, ...) collapse onto the same workspace key.

Operating System

Windows 11

Terminal

N/A (desktop app / Electron)

Activity

  1. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

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

  2. Hona commented on Sep 2, 2026

    @Hona
    Member
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