Session not found: ses_xxxxxx #8452

Open
opened 2026-02-16 18:10:00 -05:00 by yindo · 1 comment
Owner

Originally created by @TheHamkerCat on GitHub (Feb 3, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

LLM was still responding but I did Ctrl+c a few times (which exited opencode immediately)

I tried to go back to my session with opencode -c but a toast on top right said Session not found: ses_xxxx

So i tried to open the session with opencode -s ses_xxxx, same error again.

I checked for logs with tail -f .local/share/opencode/log/2026-02-03Txxxx.log

And it was showing this error:

INFO  2026-02-03T19:24:58 +32690ms service=server method=GET path=/session/ses_xxxxxxxx request
INFO  2026-02-03T19:24:58 +0ms service=server status=started method=GET path=/session/ses_xxxxxxxx request
INFO  2026-02-03T19:24:58 +1ms service=server url=http://opencode.internal/session/ses_xxxxxxxx SEARCH
INFO  2026-02-03T19:24:58 +0ms service=server method=GET path=/session/ses_xxxxxxxx/message request
INFO  2026-02-03T19:24:58 +0ms service=server status=started method=GET path=/session/ses_xxxxxxxx/message request
INFO  2026-02-03T19:24:58 +1ms service=server method=GET path=/session/ses_xxxxxxxx/todo request
INFO  2026-02-03T19:24:58 +0ms service=server status=started method=GET path=/session/ses_xxxxxxxx/todo request
INFO  2026-02-03T19:24:58 +0ms service=server method=GET path=/session/ses_xxxxxxxx/diff request
INFO  2026-02-03T19:24:58 +0ms service=server status=started method=GET path=/session/ses_xxxxxxxx/diff request
INFO  2026-02-03T19:24:58 +1ms service=server status=completed duration=3 method=GET path=/session/ses_xxxxxxxx request
INFO  2026-02-03T19:24:58 +0ms service=server status=completed duration=1 method=GET path=/session/ses_xxxxxxxx/todo request
INFO  2026-02-03T19:24:58 +5ms service=server status=completed duration=6 method=GET path=/session/ses_xxxxxxxx/diff request
ERROR 2026-02-03T19:24:58 +1ms service=server error=Unexpected end of JSON input failed
INFO  2026-02-03T19:24:58 +0ms service=server status=completed duration=8 method=GET path=/session/ses_xxxxxxxx/message request

Look at the last second line

ERROR 2026-02-03T19:24:58 +1ms service=server error=Unexpected end of JSON input failed

I used llm to find out which json file was broken by walking the dir and trying to parse it

Image

Had to delete the file to get into my session again, looks like closing opencode somehow corrupted some "part"

Plugins

None

OpenCode version

1.1.49

Steps to reproduce

I tried but couldn't reproduce again.

Screenshot and/or share link

No response

Operating System

archlinux - Linux 6.18.7-arch1-1

Terminal

alacritty 0.16.1

Originally created by @TheHamkerCat on GitHub (Feb 3, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description LLM was still responding but I did Ctrl+c a few times (which exited opencode immediately) I tried to go back to my session with `opencode -c` but a toast on top right said `Session not found: ses_xxxx` So i tried to open the session with `opencode -s ses_xxxx`, same error again. I checked for logs with `tail -f .local/share/opencode/log/2026-02-03Txxxx.log` And it was showing this error: ```bash INFO 2026-02-03T19:24:58 +32690ms service=server method=GET path=/session/ses_xxxxxxxx request INFO 2026-02-03T19:24:58 +0ms service=server status=started method=GET path=/session/ses_xxxxxxxx request INFO 2026-02-03T19:24:58 +1ms service=server url=http://opencode.internal/session/ses_xxxxxxxx SEARCH INFO 2026-02-03T19:24:58 +0ms service=server method=GET path=/session/ses_xxxxxxxx/message request INFO 2026-02-03T19:24:58 +0ms service=server status=started method=GET path=/session/ses_xxxxxxxx/message request INFO 2026-02-03T19:24:58 +1ms service=server method=GET path=/session/ses_xxxxxxxx/todo request INFO 2026-02-03T19:24:58 +0ms service=server status=started method=GET path=/session/ses_xxxxxxxx/todo request INFO 2026-02-03T19:24:58 +0ms service=server method=GET path=/session/ses_xxxxxxxx/diff request INFO 2026-02-03T19:24:58 +0ms service=server status=started method=GET path=/session/ses_xxxxxxxx/diff request INFO 2026-02-03T19:24:58 +1ms service=server status=completed duration=3 method=GET path=/session/ses_xxxxxxxx request INFO 2026-02-03T19:24:58 +0ms service=server status=completed duration=1 method=GET path=/session/ses_xxxxxxxx/todo request INFO 2026-02-03T19:24:58 +5ms service=server status=completed duration=6 method=GET path=/session/ses_xxxxxxxx/diff request ERROR 2026-02-03T19:24:58 +1ms service=server error=Unexpected end of JSON input failed INFO 2026-02-03T19:24:58 +0ms service=server status=completed duration=8 method=GET path=/session/ses_xxxxxxxx/message request ``` Look at the last second line ```bash ERROR 2026-02-03T19:24:58 +1ms service=server error=Unexpected end of JSON input failed ``` I used llm to find out which json file was broken by walking the dir and trying to parse it <img width="1880" height="1525" alt="Image" src="https://github.com/user-attachments/assets/3a3ed939-015f-4d0e-b0fa-91a04ada6407" /> Had to delete the file to get into my session again, looks like closing opencode somehow corrupted some "part" ### Plugins None ### OpenCode version 1.1.49 ### Steps to reproduce I tried but couldn't reproduce again. ### Screenshot and/or share link _No response_ ### Operating System archlinux - Linux 6.18.7-arch1-1 ### Terminal alacritty 0.16.1
yindo added the bug label 2026-02-16 18:10:00 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 3, 2026):

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

  • #9673: "session not found" after WSL crash - Similar corrupted session files (null bytes found in JSON)
  • #7607: If disk space runs out your active session becomes corrupted - Documents truncated JSON files causing "Unexpected end of JSON input" errors
  • #7715: Unexpected end of json - Related JSON parsing failures in session files

All three issues describe corrupted JSON part files in the storage directory that prevent sessions from being loaded, which matches your scenario where closing OpenCode corrupted a JSON file that had to be deleted to recover the session.

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

@github-actions[bot] commented on GitHub (Feb 3, 2026): This issue might be a duplicate of existing issues. Please check: - #9673: "session not found" after WSL crash - Similar corrupted session files (null bytes found in JSON) - #7607: If disk space runs out your active session becomes corrupted - Documents truncated JSON files causing "Unexpected end of JSON input" errors - #7715: Unexpected end of json - Related JSON parsing failures in session files All three issues describe corrupted JSON part files in the storage directory that prevent sessions from being loaded, which matches your scenario where closing OpenCode corrupted a JSON file that had to be deleted to recover the session. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8452