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
OpenCode Desktop workspace does not detect manually created git worktrees #31851
Description
Manually created git worktrees (via git worktree add) are completely unusable in OpenCode Desktop due to two issues:
Not discovered in workspace — Manually created worktrees do not appear in the project sidebar's workspace list
Cannot be opened as a separate project — Attempting to add them via Ctrl+O as an independent project also fails (likely because the .git file points to a known repository, causing it to be associated with an existing project without scanning its path)
This makes manually created worktree branches entirely unavailable for AI-assisted development through OpenCode Desktop.
Root Cause Analysis
Analysis of OpenCode Desktop runtime data (%APPDATA%/ai.opencode.desktop/opencode.global.dat) confirms:
Workspace discovery only scans OpenCode's own worktree path:
~/.local/share/opencode/worktree//
From the layout.page.workspaceOrder data, workspace children under the lost-found project only include:
"workspaceOrder": {
"D:\java\lost-found": [
"C:\Users\...\.local\share\opencode\worktree\\silent-pixel",
"C:\Users\...\.local\share\opencode\worktree\\crisp-sailor",
"C:\Users\...\.local\share\opencode\worktree\\happy-island"
]
}
Expected Behavior
Manually created git worktrees should:
Automatically appear in the workspace list (as a child of the corresponding project, showing the branch name)
Or at minimum, be addable as an independent project via Ctrl+O
Plugins
No response
OpenCode version
1.17.3
Steps to reproduce
Inside an existing git repository, manually create a worktree:
git worktree add ../repo-branch feature-branch
Open the workspace sidebar for that project in OpenCode Desktop
Observe: the manually created worktree does not appear in the list (only worktrees created by OpenCode itself under ~/.local/share/opencode/worktree/ appear)
Try Ctrl+O to open a project and select the manually created worktree directory
Observe: it cannot be added as an independent project
Screenshot and/or share link
No response
Operating System
windows 11
Terminal
No response
Reacted by HugoAVRIL, Ark, Nuno Vieira, Esa-Matti Suuronen and Christoffer
Previously, because the backend database was too large and the webui often crashed, I cleaned up the database and also upgraded the system. But for some reason, the new version 1.17 server can no longer return folders from custom paths I enter to add to the workspace. For example, a path like "/mnt/sdb1" that is clearly not based on "/home" — it just tells me no results were found.
I'm certain this is a server-side issue, because I tried accessing it through both webui 1.16.2 and the locally installed desktop version 1.14 that I haven't had time to update yet, and the problem occurred in both cases. This basically rules out it being a client-side problem. The client clearly did send the query, and it could even correctly retrieve the recent project list provided by the new version 1.17 server, but there were only a handful of recent projects.
i have the same issue, i use a custom script to create/remove worktrees but the list never refreshes automatically, a button at the top to trigger a refresh on the list would be a nice addition.
as a workaround, creating and deleting a temp worktree in the desktop app refreshes the cache and properly add/remove worktrees edited externally
EDIT: the workaround doesn't seem to work anymore
I have the same issue with opencode web, the workaround is create the session using opencode cli (a simple opencode .) and use this session in opencode web.
1.cd worktree1
2. opencode .
3. in the opencode execute a shell command (with !) to verify the current folder echo $PWD and git status, or just prompt to the model
4. now go to the opencode web and the new session will be there, you can verify the current folder using the same commands just to double check
Activity
github-actions commentedon Jun 11, 2026
This issue might be a duplicate of existing issues. Please check:
git worktree add) do not appear in the workspace list; only worktrees created through OpenCode itself are discoveredlangyo commentedon Jun 11, 2026
Same issue
Previously, because the backend database was too large and the webui often crashed, I cleaned up the database and also upgraded the system. But for some reason, the new version 1.17 server can no longer return folders from custom paths I enter to add to the workspace. For example, a path like "/mnt/sdb1" that is clearly not based on "/home" — it just tells me no results were found.
I'm certain this is a server-side issue, because I tried accessing it through both webui 1.16.2 and the locally installed desktop version 1.14 that I haven't had time to update yet, and the problem occurred in both cases. This basically rules out it being a client-side problem. The client clearly did send the query, and it could even correctly retrieve the recent project list provided by the new version 1.17 server, but there were only a handful of recent projects.
Myouboku commentedon Jun 12, 2026
i have the same issue, i use a custom script to create/remove worktrees but the list never refreshes automatically, a button at the top to trigger a refresh on the list would be a nice addition.
as a workaround, creating and deleting a temp worktree in the desktop app refreshes the cache and properly add/remove worktrees edited externally
EDIT: the workaround doesn't seem to work anymore
LaercioSantana commentedon Aug 3, 2026
I have the same issue with opencode web, the workaround is create the session using opencode cli (a simple
opencode .) and use this session in opencode web.1.
cd worktree12.
opencode .3. in the opencode execute a shell command (with !) to verify the current folder
echo $PWDandgit status, or just prompt to the model4. now go to the opencode web and the new session will be there, you can verify the current folder using the same commands just to double check
github-actions commentedon Oct 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.