Skip to content

Revert blocking state DB initialization#21483

Open
pakrym-oai wants to merge 1 commit intomainfrom
pakrym/revert-20689-state-db-init
Open

Revert blocking state DB initialization#21483
pakrym-oai wants to merge 1 commit intomainfrom
pakrym/revert-20689-state-db-init

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

Why

PR #20689 made app-server startup require successful SQLite state DB initialization. That turns a local state-store failure into a process startup failure. Before that change, Codex logged the initialization failure and continued with DB-backed features disabled or degraded.

This PR restores the previous nonblocking behavior without creating a temporary or fake runtime DB.

What Changed

  • Treat the process state DB as Option<StateDbHandle> through app-server, in-process app-server, core ThreadManager, MCP server, and local ThreadStore.
  • Start log DB and remote control only when the real state DB initializes; return explicit unavailable errors for DB-only operations such as device keys, thread goals, and memory reset.
  • Let rollout-backed thread reads/listing/name updates continue without SQLite, while preserving DB-backed metadata/search when a real DB exists.
  • Update tests to create a real per-test state DB only for scenarios that exercise DB-backed behavior.

Verification

  • cargo test -p codex-app-server --lib
  • cargo test -p codex-core --lib
  • cargo test -p codex-thread-store
  • targeted codex-core agent/session/multi-agent tests
  • cargo check -p codex-core -p codex-app-server -p codex-mcp-server -p codex-thread-manager-sample -p codex-thread-store -p codex-app-server-client
  • just fix -p codex-core -p codex-core-api -p codex-app-server -p codex-app-server-client -p codex-mcp-server -p codex-thread-manager-sample -p codex-thread-store

@pakrym-oai pakrym-oai marked this pull request as ready for review May 7, 2026 05:00
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 7, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant