OpenCode Desktop incorrectly opens parent git modules folder instead of submodule worktree #8298

Closed
opened 2026-02-16 18:09:37 -05:00 by yindo · 2 comments
Owner

Originally created by @maxsommer on GitHub (Feb 2, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Description

When I try to open a project in OpenCode Desktop that is actually a Git submodule (i.e., located inside another Git repository with .gitmodules), OpenCode opens the parent directory's .git/modules/ folder as the project root instead of the submodule's working directory. This leads to confusion and prevents me from working in the correct directory. I want to treat each git submodule as its own independent project in OpenCode, but currently it is not possible because OpenCode resolves the project root improperly for submodules.

Plugins

None

OpenCode version

1.1.42

Steps to reproduce

  1. Have a parent git repo with one or more submodules.
  2. Open OpenCode Desktop.
  3. Attempt to open a submodule folder (not the parent, but the submodule itself) as a project in OpenCode.
  4. Observe that OpenCode instead treats the project root as the parent repo's .git/modules/ path, not the actual submodule directory you selected.

Screenshot and/or share link

No response

Operating System

macOS

Terminal

Warp with zsh

Originally created by @maxsommer on GitHub (Feb 2, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Description When I try to open a project in OpenCode Desktop that is actually a Git submodule (i.e., located inside another Git repository with .gitmodules), OpenCode opens the parent directory's .git/modules/<submodule> folder as the project root instead of the submodule's working directory. This leads to confusion and prevents me from working in the correct directory. I want to treat each git submodule as its own independent project in OpenCode, but currently it is not possible because OpenCode resolves the project root improperly for submodules. ### Plugins None ### OpenCode version 1.1.42 ### Steps to reproduce 1. Have a parent git repo with one or more submodules. 2. Open OpenCode Desktop. 3. Attempt to open a submodule folder (not the parent, but the submodule itself) as a project in OpenCode. 4. Observe that OpenCode instead treats the project root as the parent repo's .git/modules/<submodule> path, not the actual submodule directory you selected. ### Screenshot and/or share link _No response_ ### Operating System macOS ### Terminal Warp with zsh
yindo added the bugweb labels 2026-02-16 18:09:37 -05:00
yindo closed this issue 2026-02-16 18:09:37 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 2, 2026):

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

  • #7769: [FEATURE] Support the desktop version of the git submodules
  • #10658: OpenCode Desktop - files touched in submodules aren't shown in Review panel
  • #2777: sdk returns wrong worktree field for projects that are submodules (similar issue with incorrect project root resolution)
  • #5638: Desktop app: opening multiple git worktrees from the same repo replaces existing project (related issue with project identification and root resolution)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 2, 2026): This issue might be a duplicate of existing issues. Please check: - #7769: [FEATURE] Support the desktop version of the git submodules - #10658: OpenCode Desktop - files touched in submodules aren't shown in Review panel - #2777: sdk returns wrong `worktree` field for projects that are submodules (similar issue with incorrect project root resolution) - #5638: Desktop app: opening multiple git worktrees from the same repo replaces existing project (related issue with project identification and root resolution) Feel free to ignore if none of these address your specific case.
Author
Owner

@maxsommer commented on GitHub (Feb 2, 2026):

Addressed by #7769

@maxsommer commented on GitHub (Feb 2, 2026): Addressed by #7769
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8298