[BUG]: TUI sessions disappear on reload on Windows even though they are saved in .local #4076

Closed
opened 2026-02-16 17:42:31 -05:00 by yindo · 2 comments
Owner

Originally created by @blackbxdev on GitHub (Jan 2, 2026).

Originally assigned to: @rekram1-node on GitHub.

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

  1. Start Opencode TUI in a project on Windows.
  2. Create a new session and chat with an agent for a while.
  3. Confirm that new files or a sessions.db appear under C:\Users<user>.local\share\opencode\storage\session
  4. Exit the TUI completely.
  5. Restart Opencode in the same project folder.
  6. 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

Originally created by @blackbxdev on GitHub (Jan 2, 2026). Originally assigned to: @rekram1-node on GitHub. ### 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 1. Start Opencode TUI in a project on Windows. 2. Create a new session and chat with an agent for a while. 3. Confirm that new files or a sessions.db appear under C:\Users\<user>\.local\share\opencode\storage\session 4. Exit the TUI completely. 5. Restart Opencode in the same project folder. 6. 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
yindo added the windowsbug labels 2026-02-16 17:42:31 -05:00
yindo closed this issue 2026-02-16 17:42:31 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 2, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #3026: /sessions shows empty despite sessions existing in storage (v0.14.6) - Similar Windows/macOS session loading issues
  • #3551: Sessions are now mixed with home directory session list, disregarding which directory you're in - Session storage and retrieval problems on Windows/WSL
  • #6098: The sessions list seems to show all history, not the sessions history of the working directory - Related session persistence issue on Windows 11

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 2, 2026): This issue might be a duplicate of existing issues. Please check: - #3026: /sessions shows empty despite sessions existing in storage (v0.14.6) - Similar Windows/macOS session loading issues - #3551: Sessions are now mixed with home directory session list, disregarding which directory you're in - Session storage and retrieval problems on Windows/WSL - #6098: The sessions list seems to show all history, not the sessions history of the working directory - Related session persistence issue on Windows 11 Feel free to ignore if none of these address your specific case.
Author
Owner

@blackbxdev commented on GitHub (Jan 2, 2026):

Deleting all session folders out of the C:\Users<user>.local\share\opencode\storage and re-creating the sessions seems to have fixed the issue for now.

@blackbxdev commented on GitHub (Jan 2, 2026): Deleting all session folders out of the C:\Users\<user>\.local\share\opencode\storage and re-creating the sessions seems to have fixed the issue for now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4076