[codex] Support SQLite-disabled degraded mode#31509
Draft
jgershen-oai wants to merge 2 commits into
Draft
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
[features] sqlite = falseas a supported escape hatch for environments where the local state database cannot be used safely, such as a Codex home on NFS.goalsandspawn_csv) and return explicit degraded-mode responses for database-only operations. Import-history reads return an empty list when no state DB exists.Root cause and impact
The
sqlitefeature was marked as removed, sosqlite = falsewas no longer an effective opt-out even though newer startup and request paths initialize and depend on the state DB. Users whose Codex state lives on filesystems with unreliable SQLite locking could therefore no longer prevent Codex from opening the database.This change makes the flag stable and configurable again while preserving the existing default of
true. It does not make SQLite safe over NFS; it provides an intentional degraded mode. In that mode, SQLite-dependent features and operations are unavailable. Explicit remote app-server targets are unchanged; only implicit local-daemon reuse falls back to the embedded server.Test plan
cargo check -p codex-cli -p codex-app-servercargo test -p codex-cli --bin codex clear_memories_rejects_disabled_sqlite_without_mutating_statecargo test -p codex-cli --test debug_clear_memoriescargo test -p codex-app-server --test all sqlite_disabledcargo test -p codex-app-server --test all non_strict_config_fallback_disables_sqlitecargo test -p codex-app-server --test all external_agent_config_import_histories_are_empty_when_sqlite_is_disabledcargo fmt --all -- --check