Skip to content

Desktop restores a moved/deleted workspace and leaves its sessions permanently failing with FileSystem.realPath ENOENT #38578

Closed

Description

@1hirak

Summary

OpenCode Desktop persists the absolute path of a workspace. If the project or one of
its parent directories is later renamed or moved, Desktop restores the stale
workspace on every launch.

The app logs a FileSystem.realPath NotFound error during startup. Sending a
prompt from a session associated with that workspace then fails in
prompt_async. There is no visible recovery flow to locate the moved project,
detach the session from the missing path, or clearly explain why the prompt
failed.

This reproduced after replacing the application with a freshly downloaded,
checksum-verified, notarized copy while retaining user data.

Environment

  • OpenCode Desktop: 1.18.4, packaged release, latest channel
  • Release commit: 49c69c5
  • Desktop runtime reported in process metadata: Electron 42.3.3
  • OS: macOS 26.5.2, build 25F84
  • Architecture: Apple silicon (arm64)
  • Hardware: Apple M4, 16 GB RAM
  • Global config:
{
  "$schema": "https://opencode.ai/config.json"
}
  • No project-specific plugin configuration was required to reproduce
  • No OpenCode crash report was created

Steps to reproduce

  1. Create or open a project at:

    /Users/USER/Projects/old-parent/example-project
    
  2. Create a session in the project and send at least one prompt.

  3. Quit OpenCode Desktop.

  4. Move or rename the project so the old path no longer exists, for example:

    /Users/USER/Projects/example-project
    
  5. Relaunch OpenCode Desktop.

  6. Open the restored session associated with the old path.

  7. Send another prompt.

Actual behavior

At startup, Desktop restores the stale absolute path and logs:

level=ERROR message=failed ref=err_REDACTED
error="PlatformError: NotFound: FileSystem.realPath
(/Users/USER/Projects/old-parent/example-project)
(cause: Error: ENOENT: no such file or directory,
lstat '/Users/USER/Projects/old-parent')"

Sending a prompt from an affected session fails:

level=ERROR message="prompt_async failed"
sessionID=ses_REDACTED
cause="Cause([Die(PlatformError: NotFound: FileSystem.realPath
(/Users/USER/Projects/old-parent/example-project)
(cause: Error: ENOENT: no such file or directory,
lstat '/Users/USER/Projects/old-parent'))])"

The main process and sidecar otherwise start normally:

app starting { version: '1.18.4', packaged: true, onboardingTest: false }
sidecar connection started { url: 'http://127.0.0.1:PORT' }
server ready { url: 'http://127.0.0.1:PORT' }

The failure repeats across restarts and attempts to use the affected sessions.

Expected behavior

When a persisted workspace path no longer exists, Desktop should do one of the
following:

  1. Prompt the user to locate the moved project and rebind the workspace and its
    sessions;
  2. Mark the workspace unavailable and provide Remove/Locate actions; or
  3. Allow the session to open in a recoverable state with a clear error instead
    of silently failing prompt_async.

At minimum, the UI should surface the missing path and should not leave the send
action appearing broken.

Clean-reinstall control

To rule out a locally damaged application:

  1. Downloaded the official opencode-desktop-mac-arm64.app.tar.gz asset for
    v1.18.4.

  2. Verified its published SHA-256 digest:

    f840b796090f557d707718078eb5d8b6b5077f6ab42e06481d7981577f83fc3f
    
  3. Replaced only /Applications/OpenCode.app; retained all user configuration,
    workspace, and session data.

  4. Verified the installed app with:

    codesign --verify --deep --strict /Applications/OpenCode.app
    spctl -a -vv /Applications/OpenCode.app
    
  5. Gatekeeper reported a notarized Developer ID build from Anomaly Innovations,
    Inc.

  6. Relaunched Desktop.

The stale-path startup error reproduced immediately after the clean reinstall.
The installed app remained signature-valid after launch.

Additional observation: existing plugin@local issue

The same clean v1.18.4 launch also logged this warning repeatedly despite the
minimal global configuration shown above:

level=WARN message="background dependency install failed"
dir=/Users/USER/.config/opencode
error="Cause([Fail(NpmInstallFailedError
(cause: @opencode-ai/plugin: No matching version found for
@opencode-ai/plugin@local.))])"

This appears to match existing issue #26003 and is included only to distinguish
that warning from the FileSystem.realPath failure. It probably should not be
tracked again in this issue unless maintainers believe the two startup paths are
connected.

Issue #14292 is also related because it discusses sessions being locked to their
original project directory, but it does not appear to cover Desktop repeatedly
restoring a missing path or the resulting prompt_async failure.

Privacy/anonymization

  • Username replaced with USER
  • Project and parent-directory names replaced with generic examples
  • Session IDs, error reference IDs, workspace/account IDs, localhost ports, and
    provider information removed or replaced
  • No authentication data, prompts, source code, repository URLs, or billing URLs
    included

Activity

  1. github-actions commented on Jul 23, 2026

    @github-actions
    Contributor

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

    If your issue is distinct from all of the above (e.g. specific to Desktop persisting and restoring the stale path across restarts rather than just a single-session failure), please clarify the difference so maintainers can track it separately.

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