mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
## Why Creating child history before persisting its parent-child relationship can leave history that parent subtree deletion cannot discover, especially when fork startup copies history. A relationship write failure must reject the spawn before child storage is created. ## What changed - Reserve the child thread ID and persist its spawn edge before starting the child. Propagate persistence failures to the caller. - Keep pending relationship writes owned through caller cancellation, and wait for them to finish before closing the edge during cleanup, including when a write commits but reports an error. - Skip edge cleanup when publication was skipped, and reject IDs belonging to running threads before publication. ## Testing Add regression coverage for cancellation before commit or acknowledgement, errors after commit, skipped publication, and duplicate child IDs. Integration tests cover fresh children and full-history forks, verifying that failed publication leaves no child history, execution, or creation notification and preserves unrelated history during parent deletion. GitOrigin-RevId: 6e2e3f32d9558091312651ab47aa845d7d13b4ca