You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Worktrees in Desktop are broken since Update to 1.3.2 #19085
In the left sidebar i don't see my real work trees anymore and instead only a single, non-deletable work tree - that doesn't even exist in git or my file storage anymore. It its only an artifact from the opencode db, that shouldnt be present in the ui anymore.
This issue occured with the new update from 1.3.0 to 1.3.2 today.
Plugins
None
OpenCode version
1.3.2
Steps to reproduce
Honestly no idea
Screenshot and/or share link
No response
Operating System
MacOS
Terminal
None
Reacted by Jacques Bodin-Hullin, Anudeep, Mike Mulhearn, Dorian Karter, Jeffrey Haen and numbr3la
Steps to reproduce are missing (marked as "No response") — please describe what you did when the broken worktree appeared, e.g. how the worktree was originally created, what actions were taken before/after the update, etc.
Operating System is missing — please provide your OS and version.
Terminal is missing — please provide the terminal you are using.
These fields help maintainers reproduce and diagnose the bug efficiently.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.
Thanks for updating the issue! It now meets the contributing guidelines and has the required information. We appreciate you taking the time to provide the details.
OpenCode/GPT found out how to fix this problem, here is the answer:
I found the issue: OpenCode has stale GUI metadata, not a real git worktree.
Real git worktrees are only /Users/admin/apps/FlowOffice and /Users/admin/apps/FlowOffice--org-wide-kanban.
The fake entry comes from cached state in /Users/admin/Library/Application Support/ai.opencode.desktop/opencode.global.dat.
That file still contains a dead sandbox /Users/admin/apps/FlowOffice--stechuhr-ux plus a duplicate FlowOffice project entry.
I also hit the reason my earlier attempt “didn’t help”:
this chat is running inside OpenCode, so the app process keeps rewriting its in-memory state back to disk while it is open.
What I did now:
I scheduled a cleanup job that waits for OpenCode to fully close, then removes the stale sandbox entry and the duplicate project metadata.
It writes a backup first.
What you need to do:
Quit OpenCode completely once.
Wait ~3-5 seconds.
Open it again.
If you want to check it worked:
log: /tmp/opencode-fix-worktree.log
backup: /Users/admin/Library/Application Support/ai.opencode.desktop/opencode.global.dat.bak-fix-...
If the fake worktree is still there after one full restart, tell me and I’ll give you the exact post-close verification command or a stronger cleanup.
log line: service=file.watcher dir=/Users/admin/apps/FlowOffice--stechuhr-ux cause=Error: No such file or directory
So the behavior seems to be:
stale sandbox metadata exists from an old sandbox/worktree
manual cleanup removes it from disk
OpenCode rehydrates/re-persistes the stale project internally
next restart shows the fake worktree again
Happy to provide a cleanup script or more logs if useful, but I think the actual fix needs to be in OpenCode's startup persistence / workspace rehydration logic.
Activity
github-actions commentedon Mar 25, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
These fields help maintainers reproduce and diagnose the bug efficiently.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Mar 25, 2026
Thanks for updating the issue! It now includes the necessary details and looks good. We appreciate you taking the time to improve it.
github-actions commentedon Mar 25, 2026
Thanks for updating the issue! It now meets the contributing guidelines and has the required information. We appreciate you taking the time to provide the details.
LeonMueller-OneAndOnly commentedon Mar 25, 2026
OpenCode/GPT found out how to fix this problem, here is the answer:
I found the issue: OpenCode has stale GUI metadata, not a real git worktree.
Real git worktrees are only /Users/admin/apps/FlowOffice and /Users/admin/apps/FlowOffice--org-wide-kanban.
The fake entry comes from cached state in /Users/admin/Library/Application Support/ai.opencode.desktop/opencode.global.dat.
That file still contains a dead sandbox /Users/admin/apps/FlowOffice--stechuhr-ux plus a duplicate FlowOffice project entry.
I also hit the reason my earlier attempt “didn’t help”:
this chat is running inside OpenCode, so the app process keeps rewriting its in-memory state back to disk while it is open.
What I did now:
I scheduled a cleanup job that waits for OpenCode to fully close, then removes the stale sandbox entry and the duplicate project metadata.
It writes a backup first.
What you need to do:
Quit OpenCode completely once.
Wait ~3-5 seconds.
Open it again.
If you want to check it worked:
log: /tmp/opencode-fix-worktree.log
backup: /Users/admin/Library/Application Support/ai.opencode.desktop/opencode.global.dat.bak-fix-...
If the fake worktree is still there after one full restart, tell me and I’ll give you the exact post-close verification command or a stronger cleanup.
LeonMueller-OneAndOnly commentedon Mar 25, 2026
The fixing script looked like this:
LeonMueller-OneAndOnly commentedon Mar 25, 2026
Okay this worked for one restart. After closing + reopening again the same issue is present again sadly
LeonMueller-OneAndOnly commentedon Mar 25, 2026
More investigation: this looks like an OpenCode persistence bug, not an actual git worktree problem.
What I verified locally:
git worktree list --porcelainonly shows the real worktrees:/Users/admin/apps/FlowOffice/Users/admin/apps/FlowOffice--org-wide-kanban/Users/admin/apps/FlowOffice--stechuhr-ux~/Library/Application Support/ai.opencode.desktop/opencode.global.datremoves it temporarily~/.local/share/opencode/storage/...also removes it temporarilyRelevant stale project/session ids that keep coming back:
031ae4e2a6141e39eda0769e1287e098ac7a01fases_4349a7199ffeqxtA0cIrfLS97aRelevant files involved:
~/Library/Application Support/ai.opencode.desktop/opencode.global.dat~/.local/share/opencode/storage/project/031ae4e2a6141e39eda0769e1287e098ac7a01fa.json~/.local/share/opencode/storage/session/031ae4e2a6141e39eda0769e1287e098ac7a01fa/...~/.local/share/opencode/storage/message/ses_4349a7199ffeqxtA0cIrfLS97a/...The strongest hint is in the desktop logs. OpenCode keeps trying to watch the deleted path on startup/restart:
~/Library/Logs/ai.opencode.desktop/opencode-desktop_2026-03-25_09-44-05.logservice=file.watcher dir=/Users/admin/apps/FlowOffice--stechuhr-ux cause=Error: No such file or directorySo the behavior seems to be:
Happy to provide a cleanup script or more logs if useful, but I think the actual fix needs to be in OpenCode's startup persistence / workspace rehydration logic.
LeonMueller-OneAndOnly commentedon Mar 25, 2026
For anyone with the same problem: Nuking your local opencode databases solves this issue, but you lose all session etc.
Here is a one liner to do this on macOS:
jacquesbh commentedon Mar 25, 2026
I can confirm that I have this issue as well. I've downgraded to 1.3.0, version where I had no issue at all.
LeonMueller-OneAndOnly commentedon Mar 25, 2026
Okay thats definitely a better solution compared to nuking your local state :D
lisongmin commentedon Mar 26, 2026
In my case, http://127.0.0.1:8088 works and http://localhost:8088 not work.
jacquesbh commentedon Apr 1, 2026
The issue is still present on 1.3.12 for me.
I'm loosing some workspaces I was working on, so I go back to 1.3.0 again.
jeffreyhaen commentedon Apr 17, 2026
Worktrees are still not working on the Windows desktop OpenCode app v1.4.7 for me.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.