opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open haal-laah opened this issue 2 weeks ago • 1 comments

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

haal-laah avatar Jan 02 '26 05:01 haal-laah