What happened?
An unclean shutdown left %APPDATA%\opencode-goal-plugin\goals.json at its full 28,454-byte length with every byte NUL — the standard NTFS failure mode where the rename's metadata commits but the data pages never flush.
On 0.1.31 this threw StateDecodeError out of the chat.message hook, which surfaced as Unexpected server error on every prompt in every session — the plugin took down the whole app. That part is fixed by #1 / 0.1.35, and the atomicWriteFile fsync work in 0.1.34 addresses the write side that produced the file. Both confirmed in main
Expected behavior
Since v0.1.35, parseStateText correctly stops a zero-filled goals.json from crashing every session (thanks — that resolved my incident's root cause). But the recovery path resets to emptyState() and reports it only through console.warn, which is invisible in the TUI. The result is that a recoverable corruption event becomes silent, total, unannounced loss of every goal.
I hit this on 2026-08-20 and lost a long-running goal that was only recoverable because I mined it back out of opencode.db by hand.
Steps to reproduce
opencode-goal-plugin-issue.md
Plugin version
0.1.31
OpenCode version
1.18.18
Operating system
windows
Model/provider in use
any model
Plugin options
Relevant goal state or logs
What happened?
An unclean shutdown left
%APPDATA%\opencode-goal-plugin\goals.jsonat its full 28,454-byte length with every byte NUL — the standard NTFS failure mode where the rename's metadata commits but the data pages never flush.On 0.1.31 this threw
StateDecodeErrorout of thechat.messagehook, which surfaced asUnexpected server erroron every prompt in every session — the plugin took down the whole app. That part is fixed by #1 / 0.1.35, and theatomicWriteFilefsync work in 0.1.34 addresses the write side that produced the file. Both confirmed inmainExpected behavior
Since v0.1.35,
parseStateTextcorrectly stops a zero-filledgoals.jsonfrom crashing every session (thanks — that resolved my incident's root cause). But the recovery path resets toemptyState()and reports it only throughconsole.warn, which is invisible in the TUI. The result is that a recoverable corruption event becomes silent, total, unannounced loss of every goal.I hit this on 2026-08-20 and lost a long-running goal that was only recoverable because I mined it back out of
opencode.dbby hand.Steps to reproduce
opencode-goal-plugin-issue.md
Plugin version
0.1.31
OpenCode version
1.18.18
Operating system
windows
Model/provider in use
any model
Plugin options
Relevant goal state or logs