-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Open
Labels
bugSomething isn't workingSomething isn't workingwebRelates to opencode on web / desktopRelates to opencode on web / desktopwindows
Description
Description
On Windows, session visibility in OpenCode Web/Desktop can break even when DB/session data is valid.
The sidebar appears to filter sessions by exact directory string.
Differences in path representation (\ vs /, B: vs b:) cause:
- Main workspace sessions not showing
- Duplicate worktree entries where one is empty
- Global project (worktree
/) showing no sessions despite/sessionAPI returning rows
This is reproducible in1.2.9and1.2.10.
Environment
- OS: Windows 10/11
- OpenCode:
1.2.9,1.2.10 - UI: Web/Desktop
- Data dir:
%USERPROFILE%\\.local\\share\\opencode
Symptoms
local: maintfor DRE sometimes shows no sessions.feature/loc-turkishappears twice in sidebar:- one entry has sessions
- the other is empty
- OpenCode-Playground sessions can be returned by
/sessionAPI but sidebar still empty.
Diagnostics / Evidence
- DB integrity and JSON sidecars are valid (
PRAGMA integrity_check = ok,json.loadpasses). - API returns healthy counts:
/session?directory=b:/dev/DRE/dre4-> hundreds of sessions
- But alternate equivalent path forms can return
0. - DEBUG logs show mixed directory contexts being created for same physical path:
directory=C:/.../crisp-planetdirectory=C:\...\crisp-planet
Expected
Path-equivalent Windows directories should be canonicalized before:
- project lookup
- workspace dedupe
- session filtering
So equivalent paths should always resolve to same workspace/session list.
Actual
Session visibility and workspace dedupe are based on raw string equality, causing empty lists and duplicate entries.
Suggested fix
Normalize path keys in one place (both read/write):
- slash normalization
- drive letter case normalization
- optional case-insensitive compare on Windows
- use normalized path for:
project.currentresolution/session?directory=...filtering- workspace deduping
- sidecar/DB consistency checks
Plugins
Unrelated
OpenCode version
1.2.10
Steps to reproduce
Repro (path sensitivity)
- Have sessions stored with directory
B:/dev/DRE/dre4(orb:/...). - Open project via another equivalent path form (
B:\dev\DRE\dre4, or case variant). - Observe sidebar session list empty or partial.
- Query API:
/session?directory=b:/dev/DRE/dre4returns sessions/session?directory=B:/dev/DRE/dre4returns0(or vice versa)
Result depends on which canonical form sessions were written with.
Repro (duplicate workspace entry)
- Enable workspaces for a repo with a local worktree (e.g.
crisp-planet). - Observe same worktree shown twice in sidebar.
- One entry resolves to
C:/.../crisp-planet, the other toC:\...\crisp-planet. - Sessions exist only under one string variant, so one duplicate workspace is empty.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal but issue only in Web UI (maybe Desktop UI as well)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingwebRelates to opencode on web / desktopRelates to opencode on web / desktopwindows