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
Core database migrations can currently make the user database incompatible with older OpenCode binaries. This breaks downgrade/recovery workflows and version-skewed installs that share the same database.
A recent example is #33378, whose 20260622142730_simplify_session_context_epoch migration dropped:
session_context_epoch.agent
session_context_epoch.replacement_seq
session_context_epoch.revision
After v1.17.10 applies that migration, downgrading to v1.17.9 can fail with SQLiteError: no such column: replacement_seq.
The existing bun packages/core/script/migration.ts --check verifies generated schema/registry consistency, but does not detect backward-incompatible schema changes. Related version-skew failures have also been reported in #31204.
Proposal
Add a migration compatibility check to CI, preferably as part of packages/core/script/migration.ts --check:
Inspect only migrations added by the PR (grandfather existing migration history).
Apply each new migration to the previous schema and compare sqlite_master, pragma_table_info, indexes, and foreign keys before/after.
Fail when an existing table or column is removed or renamed, or when a change makes old writers incompatible (for example, adding a required column without a compatible default).
Statically reject obvious destructive SQL such as DROP COLUMN, DROP TABLE, and table/column renames so failures have a clear message.
Provide an explicit, narrowly scoped compatibility escape hatch for intentionally destructive migrations, requiring review and rationale.
The default migration policy should be expand-contract: stop reading/writing obsolete fields first, but retain their physical columns and compatible defaults for the supported downgrade window.
Acceptance criteria
A PR containing ALTER TABLE ... DROP COLUMN ... in a new Core migration fails CI by default.
The failure explains that newer databases must remain usable by the supported previous OpenCode version(s).
Existing historical migrations do not fail the new check.
An explicit reviewed override exists for intentional compatibility breaks.
Ideally, CI also includes a smoke test that upgrades a database with the candidate build and then runs the previous released binary against it.
This appears to be a feature/CI improvement request but does not use the Feature Request template. Feature request titles should start with [FEATURE]: and include the required verification checkbox confirming the issue hasn't already been filed.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
I ran into this in a wonderful way. I have opencode excluded from my minimum release requirement within my root bunfig toml and I installed the latest version of opencode. but it didn't install the binaries for macos due to this post install issue i've referenced a while back #30812 (my .npmrc also has a minimum release age set and npm doesnt support exclusions so opencode binaries fail to install that way).
then I've downgraded to 1.17.9 and then ran into this issue where if I send a message, wait for a response, and then switch mode, and then message again, it crashes with "replacement_seq" sqlite error
Activity
github-actions commentedon Jun 25, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:and include the required verification checkbox confirming the issue hasn't already been filed.Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
DELETE FROM event,UPDATE session SET workspace_id = NULL) caused user-visible data loss/invisible sessions — related symptom of missing migration compatibility enforcementNOT NULL constraint failedafter a migration added a required column without a default — directly related migration backward-compatibility breakage (now closed)If you believe this was flagged incorrectly, please let a maintainer know.
eersnington commentedon Jun 25, 2026
Very good clanker.
I ran into this in a wonderful way. I have opencode excluded from my minimum release requirement within my root bunfig toml and I installed the latest version of opencode. but it didn't install the binaries for macos due to this post install issue i've referenced a while back #30812 (my .npmrc also has a minimum release age set and npm doesnt support exclusions so opencode binaries fail to install that way).
then I've downgraded to 1.17.9 and then ran into this issue where if I send a message, wait for a response, and then switch mode, and then message again, it crashes with "replacement_seq" sqlite error
github-actions commentedon Jun 25, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.
Feel free to open a new issue that follows our issue templates.
eersnington commentedon Jun 25, 2026
sidenote: this is is fixed in https://github.com/anomalyco/opencode/releases/tag/v1.17.11