Skip to content

bridge: restore fork lineage on cold thread lists - #218

Draft
0xSero wants to merge 1 commit into
mainfrom
codex/fix-fork-rediscovery
Draft

bridge: restore fork lineage on cold thread lists#218
0xSero wants to merge 1 commit into
mainfrom
codex/fix-fork-rediscovery

Conversation

@0xSero

@0xSero 0xSero commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Purpose

Fix persistent fork rediscovery after leaving a session or restarting Litter. Fixes #150 when merged.

Root cause

The fork rollout is durable and thread/read returns its forkedFromId, but the upstream local thread-store list projection discarded that immutable field. After a cold restart, thread/list therefore returned the fork without lineage, so the Forks projection could not identify it.

Changes

  • add a narrow Codex patch that restores forked_from_id from the canonical first session metadata record for non-state-DB-only lists
  • preserve the state-DB-only contract by performing no filesystem read for those requests
  • add a cold-store regression proving a persistent fork is rediscovered with its parent id
  • wire the patch into the normal Codex sync and unpatch lanes

Verification

  • cargo test -p codex-thread-store cold_list_threads_preserves_fork_lineage_from_rollout -- --nocapture
  • cargo test -p codex-thread-store (73 passed)
  • built the patched codex-app-server binary
  • end-to-end synthetic acceptance: fork persistent rollout, terminate app-server, start a fresh process, verify thread/list finds the fork with the same forkedFromId, and verify thread/read agrees
  • bash -n apps/ios/scripts/sync-codex.sh
  • clean apply and reverse-apply checks against pinned Codex 13595c36e218fcbd13df118eeadf00d4eb0e6d31

Remaining acceptance

A physical iPhone This Device flow and a remote VM flow still need UI-level validation before merge: fork, send a follow-up, leave the conversation, force restart, reopen from Sessions and the Forks filter, and continue the thread. The PR stays draft until those two acceptance surfaces are proven.

@0xSero 0xSero added bug Something isn't working priority: critical Must land in the current stabilization window labels Aug 4, 2026
@0xSero

0xSero commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

The remaining Mobile CI run was intentionally canceled after shared-prep passed, to prioritize #221's clean-runner test-hermeticity gate. #218 already has 73/73 upstream thread-store tests and a real two-process app-server restart probe, and remains draft for physical-iPhone/remote-VM UI acceptance. Rerun the platform matrix with that acceptance before readiness; this cancellation is scheduling, not a failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: critical Must land in the current stabilization window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forked chat/thread becomes inaccessible after leaving session

1 participant