Skip to content

OpenCode Desktop workspace does not detect manually created git worktrees #31851

Closed as not planned

Description

@zero-face

Description

Description
Manually created git worktrees (via git worktree add) are completely unusable in OpenCode Desktop due to two issues:

  1. Not discovered in workspace — Manually created worktrees do not appear in the project sidebar's workspace list
  2. 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

  1. Inside an existing git repository, manually create a worktree:
    git worktree add ../repo-branch feature-branch
  2. Open the workspace sidebar for that project in OpenCode Desktop
  3. Observe: the manually created worktree does not appear in the list (only worktrees created by OpenCode itself under ~/.local/share/opencode/worktree/ appear)
  4. Try Ctrl+O to open a project and select the manually created worktree directory
  5. Observe: it cannot be added as an independent project

Screenshot and/or share link

No response

Operating System

windows 11

Terminal

No response

Activity

  1. github-actions commented on Jun 11, 2026

    @github-actions
    Contributor

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

  2. langyo commented on Jun 11, 2026

    @langyo

    Same issue

    Image

    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.

  3. Myouboku commented on Jun 12, 2026

    @Myouboku

    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

  4. LaercioSantana commented on Aug 3, 2026

    @LaercioSantana

    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

  5. github-actions commented on Oct 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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