Skip to content

[BUG][Windows] Same workspace appears twice in sidebar (one empty, one populated) due to path variant mismatch #14571

@EgilSandfeld

Description

@EgilSandfeld

Description

Summary

On Windows, a single git worktree can appear twice in OpenCode Web/Desktop sidebar (e.g. feature/loc-turkish), where one entry has sessions and the other shows none.
This appears to happen when the same physical path is represented with different string forms (C:/... vs C:\..., and sometimes drive-case differences), and dedupe/filtering is strict string-based.

Environment

  • OpenCode: 1.2.9 and 1.2.10
  • OS: Windows
  • Web/Desktop UI
  • Workspaces enabled

Evidence

  • Session rows exist for only one exact directory string (example: C:/Users/.../crisp-planet).
  • API/log behavior shows both slash styles being used for same worktree context.
  • Sidebar appears to treat these as separate workspaces rather than canonical equivalents.

Expected

  • Workspace list dedupes equivalent Windows paths.
  • Session filtering canonicalizes directory path before matching.

Actual

  • Duplicate workspace rows appear.
  • One duplicate row has no sessions.

Suggested fix

  • Canonicalize all workspace/session path keys on Windows before:
    • workspace list generation/dedupe
    • session filtering
    • project sandbox/worktree serialization

Plugins

Unrelated

OpenCode version

1.2.10

Steps to reproduce

  1. Use repo with workspaces/worktrees enabled.
  2. Have a worktree at .../crisp-planet.
  3. Open sidebar workspace selector.
  4. Observe duplicate entry for same branch/worktree.
  5. One entry has sessions; the other entry is empty.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktopwindows

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