Skip to content

fix: backfill previews for existing reference-backed forks - #1

Open
balvisio wants to merge 1 commit into
mainfrom
fix/fork-preview-backfill
Open

balvisio wants to merge 1 commit into
mainfrom
fix/fork-preview-backfill

Conversation

@balvisio

Copy link
Copy Markdown
Owner

Older reference-backed forks can remain missing from /resume after upgrading: an empty SQLite preview causes the database-only picker to filter out a fork even when it has inherited user history. Creating previews for new forks does not repair existing rows. Related issue: openai#39553.

Backfill missing previews once per local thread-store instance, before listing filters and pagination run. Resolve each fork's inherited history at its saved boundary and reuse the existing first-user-preview projection. Only update an empty preview; preserve names, timestamps, and rollout contents, and skip missing or invalid rollouts without failing the listing.

Regression coverage includes nested forks, one-row pagination, repeated listing, existing previews, empty roots, metadata preservation, and exclusion of parent messages added after the fork boundary.

Validation on current upstream main (641b4ca), with Rust 1.99.1:

  • cargo test --locked -p codex-thread-store --lib: 296 passed.
  • cargo fmt --all -- --check: passed.
  • cargo clippy --locked -p codex-state -p codex-thread-store --tests -- -D warnings: passed.
  • git diff --check: passed.

The regression fixtures are synthetic, with identifiers generated at test runtime. No user conversation data is included.

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