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
[Bug]: v1.17.10 Bun segfault + downgrade to v1.17.9 breaks SQLite schema (missing replacement_seq column) #33773
Two related issues occur when running OpenCode on Windows:
Issue 1: v1.17.10 Bun Segmentation Fault
OpenCode v1.17.10 crashes due to a segmentation fault from the embedded Bun v1.3.14 runtime.
Crash Log:
plaintext
Bun v1.3.14 (0d9b296a) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2 avx512
panic(main thread): Segmentation fault at address 0x1C4D851CAA2
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Runtime memory metrics at crash time: RSS 1.17GB / Peak 1.18GB / Commit 1.73GB / Faults 558638.
Issue 2: SQLite Schema Incompatibility After Downgrading to v1.17.9
After downgrading from v1.17.10 to v1.17.9 to bypass the Bun crash, a runtime SQLite error blocks startup:
plaintext
SQLiteError: no such column: replacement_seq
at prepare (bun:sqlite:345:37)
at SessionContextEpoch.requestReplacement
at SessionPrompt.createUserMessage
at SessionPrompt.prompt
at SessionHttpApi.prompt
Root Cause Analysis
v1.17.10 introduced a schema migration that added the replacement_seq column to the session_context_epoch table. Once the database is upgraded by v1.17.10, downgrading to v1.17.9 does not trigger any rollback migration. The older version’s code still attempts to query this newly added column in certain code paths, resulting in a missing column error.
Plugins
No response
OpenCode version
1.17.10
Steps to reproduce
1./compact
2./sessions
Screenshot and/or share link
No response
Operating System
win11
Terminal
No response
Reacted by KhanhDz, Juan Diego Coianiz, 5BL4, osssx, XHLAples, Rizky Putra Ednar, Luis Diego Cubero Chavarría, 陈序员, SR90MJ, Chansa Garcia and 7 more
For now, I downgraded to 1.17.9. OpenCode insisted on autoupdating, so I disabled it. However, I still encountered the same SQL error.
I managed to fix it by deleting the .db files in the %USER%.local\share\opencode directory. I lost my session history, but OpenCode is working again.
Reacted by Chansa Garcia, yurvon-screamo, XY DENG and palomino
It says v1.17.10 added the replacement_seq column. It is the opposite — the migration removes it.
PR #33378 (the simplify refactor in v1.17.10) did three things together:
Added a migration: DROP COLUMN replacement_seq
Removed the column from the runtime schema
Removed the requestReplacement function entirely
So v1.17.10 is consistent with itself — the column is gone, and the code does not need it. No error on v1.17.10 alone.
The error only happens when old code meets the new schema. Two ways that can happen:
You downgrade — upgraded to 1.17.10, migration ran (column dropped), then went back to 1.17.9. Old requestReplacement still reads replacement_seq, column does not exist anymore. This is what the issue describes.
Stale process — e.g. an opencode serve daemon from before the upgrade is still running with old code. The new TUI sends prompt_async requests to it over HTTP. The daemon runs the old code, hits the deleted column, and fails. The error shows up in your TUI because it is the HTTP response coming back. This is what I ran into.
Activity
github-actions commentedon Jun 25, 2026
This issue might be a duplicate of existing issues. Please check:
The SQLite schema incompatibility after downgrade (
replacement_seqcolumn missing) appears to be a separate/new issue not previously reported.Simon7612 commentedon Jun 25, 2026
I encountered the same problem and have already reported it to BUN
BrunoEdPerezS commentedon Jun 25, 2026
For now, I downgraded to 1.17.9. OpenCode insisted on autoupdating, so I disabled it. However, I still encountered the same SQL error.
I managed to fix it by deleting the .db files in the %USER%.local\share\opencode directory. I lost my session history, but OpenCode is working again.
hyxieshi commentedon Jun 25, 2026
The desktop version of OpenCode can be downloaded to retain chat records.
g98051815 commentedon Jun 25, 2026
Found a mistake in the issue description.
It says v1.17.10 added the
replacement_seqcolumn. It is the opposite — the migration removes it.PR #33378 (the simplify refactor in v1.17.10) did three things together:
DROP COLUMN replacement_seqrequestReplacementfunction entirelySo v1.17.10 is consistent with itself — the column is gone, and the code does not need it. No error on v1.17.10 alone.
The error only happens when old code meets the new schema. Two ways that can happen:
You downgrade — upgraded to 1.17.10, migration ran (column dropped), then went back to 1.17.9. Old
requestReplacementstill readsreplacement_seq, column does not exist anymore. This is what the issue describes.Stale process — e.g. an
opencode servedaemon from before the upgrade is still running with old code. The new TUI sendsprompt_asyncrequests to it over HTTP. The daemon runs the old code, hits the deleted column, and fails. The error shows up in your TUI because it is the HTTP response coming back. This is what I ran into.Simon7612 commentedon Jun 25, 2026
I use SCOOP to manage OpenCode, and after downgrading to 1.17.9 via SCOOP, I haven't encountered SQLite errors
simonklee commentedon Jun 25, 2026
We'll cut a release which should allow you to upgrade.