Skip to content

Desktop 1.18.30: opening a moved Git project reuses its missing canonical path and stale session directories #48278

Closed

Description

@yrain

Description

OpenCode Desktop 1.18.30 redirects a moved Git project back to its old, nonexistent directory, even when I explicitly select the new directory in “Open project.”

Related: #47803 and #46330. I saw that #46330 was closed via #46713 for the OpenCode 2 launch. This report confirms the behavior on the 1.18.30 desktop release; I have not tested the OpenCode 2 beta. The PR description also explicitly leaves existing session history unchanged.

Steps to reproduce

  1. Open a Git project at /Users/example/dev/old/repo in Desktop and create a session.
  2. Move the project, including .git, to /Users/example/dev/new/repo. The old directory no longer exists.
  3. In Desktop, choose Open project and explicitly select the new directory.
  4. Desktop resolves the project back to the old location instead of consistently opening the selected directory.

Expected: Open the selected directory. If existing sessions still reference a missing location, provide a supported way to reassociate them while preserving history.

Actual: The old canonical path is retained and reused. The backend can initialize the new directory, but logs also contain FileSystem.realPath / ENOENT failures for previously registered locations.

Diagnostic evidence

Paths and project identifiers below are anonymized. Inspection before the local repair showed:

Record Stored value
project.id Same project ID before/after the move, also cached in .git/opencode
project.worktree /Users/example/dev/old/repo (missing)
project.sandboxes ["/Users/example/dev/new/repo"]
project_directory.directory /Users/example/dev/new/repo
session.directory 8 existing sessions still bound to the old directory

Desktop's opencode.global.dat also retained old locations in server, layout and layout.page, including encoded session-route keys.

In Project.fromDirectory at v1.18.30, an existing non-global project's canonical path is retained:

worktree: projectID === ProjectV2.ID.global ? worktree : existing.worktree,

The newly resolved directory is then added to sandboxes; the existence filtering below applies to sandboxes, not the retained worktree. This matches the database state above.

Local recovery required backing up the database/UI state and correcting the project path, affected session directories and desktop navigation references. Database integrity and preservation of all 8 session records were verified; final UI verification after restarting was still pending when preparing this report. A supported relocation/recovery flow would avoid manual SQLite and desktop-state edits.

Plugins

oh-my-openagent@latest is configured. The log also contains a separate plugin-loading error involving the bun: protocol. I have not reproduced this in plugin-free mode; the project-path persistence behavior above was verified independently in the database and shipped source.

OpenCode version

Desktop 1.18.30 (Electron). Separately installed CLI: 1.17.9; the reported workflow uses Desktop.

Operating System

macOS 26.5.2, build 25F84, Apple Silicon (arm64).

Terminal

Not applicable: Desktop's project picker.

Activity

  1. bebauke commented on Sep 10, 2026

    @bebauke

    Confirmed on Windows / OpenCode Desktop 1.18.30 with the same failure mode after moving and renaming a Git project while preserving .git.

    Before repair, the SQLite state was:

    • project.id: unchanged and reused for the moved repository
    • project.worktree: old deleted directory
    • project.sandboxes: contained the new directory
    • project_directory.directory: contained the new directory
    • Three existing session.directory values: old deleted directory

    Selecting the new project successfully initialized and watched the new path, but opening existing chats also created an instance for the deleted path and immediately logged PlatformError: NotFound: FileSystem.realPath (...), caused by ENOENT. From the UI, chats appeared to end abruptly.

    A local workaround was to back up ~/.local/share/opencode/opencode.db, update the matching project.worktree, session.directory, and matching non-empty session.path values to the new directory, then restart Desktop. PRAGMA integrity_check returned ok, all three sessions were preserved, and no active project/session route still referenced the deleted location.

    This confirms the issue is not macOS-specific and that updating only sandboxes / project_directory is insufficient for existing sessions.

  2. roalvesrj commented on Oct 7, 2026

    @roalvesrj

    I can confirm the same problem here, even using the latest updates!

  3. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the detailed diagnosis of the moved repository and its existing sessions. v2 updates a missing canonical project path when you open the moved repository, and sessions with unavailable directories offer a directory picker to reassociate them without manual database edits. v1 now receives only critical fixes; please update the desktop app, or install the v2 CLI with npm i -g @opencode/cli@latest. If opening the moved project or reassociating its sessions still fails on v2, please open a new issue with those details.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions