Skip to content

Sessions from other worktrees of the same project are no longer visible after upgrade #23594

@laozhoulaile

Description

@laozhoulaile

Description

Sessions created in other git worktrees of the same repository are no longer visible when running opencode from a different worktree. This worked before upgrading to v1.14.19 (previous 1.2.25).

Steps to Reproduce

  1. Have a git repo with multiple worktrees (e.g. C:\Work\fireyes as main, C:\Work\fireyes-workflows as a worktree)
  2. Create sessions in the main worktree directory
  3. Open opencode from the worktree directory
  4. Sessions list only shows sessions created in the current worktree directory(empty at the beginning actually), not the ones from the main repo or other worktrees

Expected Behavior

Since all worktrees share the same project_id (computed from git rev-list --max-parents=0 HEAD), all sessions belonging to the same project should be visible regardless of which worktree directory they were created in. The sandboxes column in the project table already tracks all worktree directories, indicating the design intent is for them to be part of the same project.

Actual Behavior

Only sessions matching the current working directory are shown. This appears to be a regression — likely the session listing now filters by directory (sandbox path) in addition to project_id, whereas previously it only filtered by project_id.

Evidence

Database query shows all sessions are correctly stored under the same project_id:
project_id: bcda27203b3ed9289ac01b7a2b20baf7c2faed00
worktree: C:\Work\fireyes
sandboxes: ["C:\Work\fireyes-ptr-pos-trading-features","C:\Work\fireyes-workflows"]

Sessions by directory:
C:\Work\fireyes → 53 sessions
C:\Work\fireyes-analysis-fund-share → 8 sessions
C:\Work\fireyes-workflows → 2 sessions ← only these are visible
... (other worktree dirs)

When running opencode from C:\Work\fireyes-workflows, only the 2 sessions with directory=C:\Work\fireyes-workflows are shown, while the other 53+ sessions from the same project are hidden.

Environment

  • opencode v1.14.19 (upgrade from v1.2.25)
  • Windows (PowerShell)
  • Git worktrees

Plugins

No response

OpenCode version

v1.14.19

Steps to reproduce

No response

Screenshot and/or share link

Image Image

Operating System

Windows 11

Terminal

Powershell

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions