fix: show git worktrees as selectable projects#83
Open
Fr4nzz wants to merge 1 commit intogrinev:mainfrom
Open
Conversation
Git worktrees (linked via .git file pointing to parent's .git/worktrees/) were explicitly filtered out of the project list by isLinkedGitWorktree(). This meant users working in worktrees could never access their sessions via the bot — /projects didn't list them and /open failed when navigating to a worktree directory. The fix: - Remove the worktree exclusion filter - Include worktree paths from the project sandboxes field returned by the OpenCode API, so worktrees appear as independent selectable projects with their own session histories - Remove the now-unused isLinkedGitWorktree() function Closes grinev#68 (partially — worktree support was a prerequisite for the group topics fork's multi-project workflow) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isLinkedGitWorktree(), making them invisible to the bot/projectsdoesn't list them and/openfails when navigating to a worktree directorysandboxesfield and supports listing sessions by worktree directory, but the bot ignores bothChanges
getProjects()sandboxesfield returned by the OpenCode project APIisLinkedGitWorktree()function and itsfs/pathimportsHow to reproduce the bug
git worktree add ../my-project-feature/projects— the worktree doesn't appear/openand navigate to the worktree — fails with "could not add project"After this fix
/projectslists worktrees alongside regular projects/opensuccessfully adds worktree directories/sessionsshows sessions created in the worktreeTest plan
/projectsshows both parent repo and worktree/sessionslists worktree-specific sessions/opencan navigate to and select a worktree directory🤖 Generated with Claude Code