You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Getting a json parse error on the prompt history and/or token error #4277
After a sudden shutdown, getting a json parse error for the prompt history, have tried removing and reinstalling, deleting the local and global config files, but no luck.
Seems like a corrupted state management file caused by an unscheduled shutdown. There should be a check on the file to avoid this, before instantiating the state history?
@rekram1-node, I had the same situation as @ubuntupunk. In my case, the history got corrupted as the partition that opencode stores ~/.local/state/opencode/prompt-history.jsonl temporarily ran out of space. From that point forward, opencode just kept writing json into that history file so it was never going to fix itself. I simply deleted the offending json line, wrote the file, restarted and retained my prompt history and everything is back to normal.
Activity
github-actions commentedon Nov 13, 2025
This issue might be a duplicate of existing issues. Please check:
ConfigInvalidErrors #4246: Configuration errors preventing OpenCode from starting properlyFeel free to ignore if none of these address your specific case with prompt history JSON parse errors.
ubuntupunk commentedon Nov 13, 2025
Here is the fix:
rm -rf ~/.local/state/opencodeHad to grep my entire home directory to find opencode is setting state under this directory.
rekram1-node commentedon Nov 13, 2025
Hm I wonder what happened
ubuntupunk commentedon Nov 14, 2025
Seems like a corrupted state management file caused by an unscheduled shutdown. There should be a check on the file to avoid this, before instantiating the state history?
rekram1-node commentedon Nov 14, 2025
yeah I think the tui state prolly got corrupted
marklise commentedon Nov 15, 2025
@rekram1-node, I had the same situation as @ubuntupunk. In my case, the history got corrupted as the partition that opencode stores
~/.local/state/opencode/prompt-history.jsonltemporarily ran out of space. From that point forward, opencode just kept writing json into that history file so it was never going to fix itself. I simply deleted the offending json line, wrote the file, restarted and retained my prompt history and everything is back to normal.rekram1-node commentedon Nov 16, 2025
next release should fix both of ur issues, for whatever reason we werent capping out # of entries to that file, now it wont grow forever lol
also introduced better error handling