Skip to content

Desktop app crashes on startup when cached workspace directory is deleted #30750

Closed as not planned

Description

@ccnyou

Description

When a workspace directory is deleted from the filesystem, the desktop app fails to start properly because it tries to restore the non-existent workspace path.

Plugins

No response

OpenCode version

1.15.11

Steps to reproduce

Open a project folder in OpenCode desktop app (e.g., /Users/UserName/Documents/Projects/SomeProject)
Close the app
Delete that folder from Finder
Open OpenCode desktop app again
Expected Behavior:

App should detect the workspace no longer exists
Prompt user to select a new workspace or clean up the invalid entry
Start normally with a new/valid workspace
Actual Behavior:

App fails to subscribe to file watcher
MCP servers (e.g., codegraph) fail to start due to invalid cwd
Multiple errors in logs:
ERROR service=file.watcher dir=/Users/UserName/Documents/Projects/SomeProject cause=Error: No such file or directory
ERROR service=mcp key=codegraph cwd=/Users/UserName/Documents/Projects/SomeProject error=spawn codegraph ENOENT local mcp startup failed

Workaround:
Delete the cached workspace data manually:
rm -rf ~/Library/Application\ Support/ai.opencode.desktop/opencode.workspace.*.dat

Environment:
OpenCode version: 1.15.11
Platform: macOS arm64
Electron: 41.2.1
Additional Context:

The workspace path appears to be cached in the desktop app's Local Storage (LevelDB format), but there's no mechanism to validate if the path still exists before attempting to use it.

Screenshot and/or share link

No response

Operating System

macOS 26.3 (25D125)

Terminal

No response

Activity

  1. github-actions commented on Jun 4, 2026

    @github-actions
    Contributor

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

  2. github-actions commented on Aug 4, 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.

  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