Repository navigation
fix(codex): discover resumed project stores through writer locks - #3825
Conversation
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Thank you again, @rocking5566. The merge pass reviewed this at 05d077a with two reviewers under the stricter bar for outside PRs; both are clear, with nothing above LOW. The Opus reviewer ran your new test file against It does not merge yet for one reason that is not about the code: a release freeze is on, and nothing touching Two LOW points, for you to take or leave (both read, not run): a writer lock released between two system calls of the scan (a subagent ending) now makes the whole lookup return null for one poll, where |
|
Thank you, @rocking5566. To keep three neighbouring Codex fixes from rotting, the merge pass read this one together with #3762 and #3442. They fix different steps of the same lookup (yours: finding the store; #3762: finding the process behind tmux; #3442: finding the conversation by its saved name), none is a duplicate, and yours conflicts with nothing. This one lands first, as soon as the release freeze ends (it touches |
Merge passMerged head
Thank you, @rocking5566. The bug was reproduced before merging: the pull request's own new test, run against One more thing this changes, for the record: a process that holds one store's database with a rollout and also another store's locked rollout was resolved to the database store on |
Brings in devswha#3825 (Codex stores found through writer locks). No conflicts; it changes how a process's Codex home is found and does not touch the saved-name recovery. Co-authored-by: sisyphus-dev-ai <[email protected]>
Change
After restarting and resuming a Codex TUI with a project-local store, Chat still falls back to empty scrollback even with #3792. The resumed process holds its interactive rollout and exclusive thread writer lock, but no longer keeps
state_5.sqliteopen. The database-plus-rollout discovery therefore cannot identify its store.Accept the store of an open interactive rollout whose session ID matches a writer lock held exclusively by the same PID. Verify ownership through Linux fdinfo, retain descriptor/path inode checks and canonical containment, and require exactly one store across database-backed and lock-backed candidates. Explicit CODEX_HOME still wins; inferred lock ownership is rechecked on every lookup.
Regression coverage includes actual kernel locks without an open database, unlock/relock without closing the file, unlocked/shared/mismatched locks, cross-store mismatches, ambiguity between two lock-backed stores or a database-backed and lock-backed store, noninteractive rollouts, replaced lock paths, and explicit CODEX_HOME.
Validation
bun test server/codex-process-lock-store.test.ts server/codex-process-store.test.ts server/codex-processes.test.ts: 299 passed.bun run check fast: workflow syntax, generated files, typecheck, and build passed. Unit results: 17,015 passed, 141 failed, 57 skipped across 944 files. All 10 new lock-store cases passed in this run. This is not a green full check. The NFS temp filesystem causes numerousEBUSYcleanup failures; additional existing failures occur in other modules. On a separate unchanged checkout of the same base (15b325e0), targeted reruns ofserver/codex.test.ts(the WAL cleanup case),server/codex-daemon.test.ts,server/conversation.test.ts,server/pc-install.test.ts, andserver/omp.test.tsreproduced 50 of the same failing cases. The remaining broad-suite failures were not individually diagnosed. Tests usedTMPDIRunder~/.cache/ovis-tmp/as required by AGENTS.md.Files with failures in the full fast check
server/codex.test.tsserver/conversation.test.tsserver/pc-install.test.tsserver/omp.test.tsserver/prompt.test.tsserver/question-steps.test.tsscripts/install-ovis-command.test.tsserver/grok.test.tsscripts/self-hosted-runner.test.tsserver/open-access.test.tsserver/codex-daemon.test.tsserver/omp-images.test.tsserver/machine-core-choice.test.tsserver/file-edit.test.tsserver/background-agent.test.tsserver/runtime-move-lock.test.tsserver/herdr-core/terminal-env.test.tsserver/pi-delivery.test.tsserver/runtime-move-stop.test.tsserver/state-document.test.tsserver/chat-read-timeout.test.tsserver/conversation-shared.test.tsserver/skills/cmd.test.tsserver/session-history.test.ts