Repository navigation
fix(sqlite): don't hard fail migrator if DB is newer - #16924
Merged
Merged
Conversation
owenlin0
marked this pull request as ready for review
April 6, 2026 18:06
owenlin0
force-pushed
the
owen/tolerant_db_mirgator
branch
from
April 6, 2026 18:13
8eb8995 to
f064dd1
Compare
owenlin0
force-pushed
the
owen/tolerant_db_mirgator
branch
from
April 6, 2026 18:58
f064dd1 to
cab599d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes the SQLite state runtime tolerate databases that have already been migrated by a newer Codex binary.
Today, if an older CLI sees migration versions in
_sqlx_migrationsthat it doesn't know about, startup fails. This change relaxes that check for the runtime migrators we use incodex-stateso older binaries can keep opening the DB in that case.Why
We can end up with mixed-version CLIs running against the same local state DB. In that setup, treating "the database is ahead of me" as a hard error is unnecessarily strict and breaks the older client even when the migration history is otherwise fine.
Follow-up
We still clean up versioned
state_*.sqliteandlogs_*.sqlitefiles during init, so older binaries can treat newer DB files as legacy. That should probably be tightened separately if we want mixed-version local usage to be fully safe.