Skip to content

fix(codex): rebuild index when source snapshot is unavailable - #123

Merged
JacobZyy merged 1 commit into
mainfrom
codex/codex-snapshot-fallback
Oct 20, 2026
Merged

JacobZyy merged 1 commit into
mainfrom
codex/codex-snapshot-fallback

Conversation

@JacobZyy

Copy link
Copy Markdown
Owner

CodeGraph worktree setup aborts when SQLite cannot read-only back up the primary WAL database, including macOS databases without WAL/SHM sidecars. Handle failure locally around both optional backup commands, preserve SQLite stderr, and let the existing init path rebuild an independent local index. Other setup failures still propagate.

Generated setup regressions cover both cache-lock branches, successful snapshots, partial-file cleanup, lock ownership, preserved caches, safety refusals, unindexed projects, and init/sync/normalization exit codes. Migration ownership hashes and custom configuration protection remain unchanged.

Validation:

  • cargo fmt --check
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --locked: 212 unit tests and 42 CLI integration tests passed, including 7 new setup tests; pre-commit repeated the full suite successfully.
  • node --test apps/jt/src/codex/dependencies.test.mjs: 9 passed.
  • Real macOS SQLite 3.54.0 WAL reproduction and generated setup in both lock branches: backup error preserved, real CodeGraph init/explore succeeded, target quick_check=ok, source SHA256 unchanged with no source sidecars, no partial database or temporary files, and another process's lock retained.

@JacobZyy
JacobZyy merged commit bad8175 into main Oct 20, 2026
2 checks passed
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