[BUG]: TUI sessions disappear on reload on Windows even though they are saved in .local
Description
On Windows, Opencode TUI appears to save sessions to %USERPROFILE%.local\share\opencode\storage\session, but after restarting Opencode the TUI shows no sessions (they vanish from /sessions), even though the session files are still present on disk. Environment
- OS: Windows 10 Pro, Version 22H2, OS Build 19045.6466
- Opencode version: 1.0.223
- Install method: npm
- Shell: Windows Terminal
Expected behavior Previously created sessions should persist and show up in /sessions, remaining selectable and resumable after a restart. Actual behavior
- After restart, the session list is empty as if there are no saved sessions.
- The files in C:\Users<user>.local\share\opencode\storage\session are still present and appear to contain data.
- New sessions created after restart also disappear once Opencode is closed and reopened.
Additional details / logs
- I can see sessions being written under C:\Users<user>.local\share\opencode\storage\session
- When running Opencode with higher log verbosity (e.g. --log-level DEBUG), the TUI starts normally and the logs don't show anything abnormal
A small snippet of the debug logs around startup and when calling /sessions:
INFO 2026-01-02T05:08:18 +149ms service=server method=GET path=/session request INFO 2026-01-02T05:08:18 +0ms service=server status=started method=GET path=/session request INFO 2026-01-02T05:08:18 +1ms service=default directory=C:\***\***\repo creating instance INFO 2026-01-02T05:08:18 +0ms service=project directory=C:\***\***\repo fromDirectory INFO 2026-01-02T05:08:18 +1ms service=server method=GET path=/config/providers request INFO 2026-01-02T05:08:18 +0ms service=server status=started method=GET path=/config/providers request INFO 2026-01-02T05:08:18 +0ms service=server method=GET path=/provider request INFO 2026-01-02T05:08:18 +0ms service=server status=started method=GET path=/provider request INFO 2026-01-02T05:08:18 +0ms service=server method=GET path=/agent request INFO 2026-01-02T05:08:18 +0ms service=server status=started method=GET path=/agent request INFO 2026-01-02T05:08:18 +0ms service=server method=GET path=/config request INFO 2026-01-02T05:08:18 +0ms service=server status=started method=GET path=/config request INFO 2026-01-02T05:08:18 +0ms service=server method=GET path=/event request INFO 2026-01-02T05:08:18 +0ms service=server status=started method=GET path=/event request
OpenCode version
1.0.223
Steps to reproduce
- Start Opencode TUI in a project on Windows.
- Create a new session and chat with an agent for a while.
- Confirm that new files or a sessions.db appear under C:\Users<user>.local\share\opencode\storage\session
- Exit the TUI completely.
- Restart Opencode in the same project folder.
- Run /sessions or open the sessions view in the TUI.
Screenshot and/or share link
No response
Operating System
Windows 10 Pro, Version 22H2, OS Build 19045.6466
Terminal
Windows Terminal