Describe the bug
The inline global session migration in fromDirectory (project.ts) uses eq(SessionTable.directory, data.worktree) — SQLite strict equality. On Windows where paths are case-insensitive, sessions stored under a directory with different casing are silently skipped during migration.
For example: sessions created in C:\ai-work\dtd\my-project (lowercase parent) are never migrated when the parent is later renamed to C:\ai-work\DTD\my-project (uppercase). The WHERE directory = 'C:\ai-work\DTD\my-project' never matches the stored lowercase path.
Related to #17183 (broader Windows path normalization).
Steps to reproduce
- Open opencode in a non-git directory (e.g.
C:\work\dtd\project) — sessions created under global
- Rename parent directory casing (e.g.
dtd → DTD)
- Run
git init + first commit in the project
- Restart opencode — migration runs but skips the old sessions because
dtd ≠ DTD
- Old sessions remain orphaned under
global
OpenCode version
1.2.24+
Operating System
Windows 10
Terminal
Windows Terminal
Describe the bug
The inline global session migration in
fromDirectory(project.ts) useseq(SessionTable.directory, data.worktree)— SQLite strict equality. On Windows where paths are case-insensitive, sessions stored under a directory with different casing are silently skipped during migration.For example: sessions created in
C:\ai-work\dtd\my-project(lowercase parent) are never migrated when the parent is later renamed toC:\ai-work\DTD\my-project(uppercase). TheWHERE directory = 'C:\ai-work\DTD\my-project'never matches the stored lowercase path.Related to #17183 (broader Windows path normalization).
Steps to reproduce
C:\work\dtd\project) — sessions created underglobaldtd→DTD)git init+ first commit in the projectdtd≠DTDglobalOpenCode version
1.2.24+
Operating System
Windows 10
Terminal
Windows Terminal