anomalyco / anomalyco/opencode
Desktop 1.18.30: opening a moved Git project reuses its missing canonical path and stale session directories
@Hona is already working on this.
Since Sep 10, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
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
- Open a Git project at
/Users/example/dev/old/repoin Desktop and create a session. - Move the project, including
.git, to/Users/example/dev/new/repo. The old directory no longer exists. - In Desktop, choose Open project and explicitly select the new directory.
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.