Skip to content

[codex] Stabilize compact resume and fork snapshot flaky tests#15605

Merged
charley-oai merged 3 commits intomainfrom
codex/stabilize-second-compaction-history-test
Mar 24, 2026
Merged

[codex] Stabilize compact resume and fork snapshot flaky tests#15605
charley-oai merged 3 commits intomainfrom
codex/stabilize-second-compaction-history-test

Conversation

@charley-oai
Copy link
Contributor

@charley-oai charley-oai commented Mar 24, 2026

Summary

  • stabilize compact_resume_after_second_compaction_preserves_history by asserting against the real /responses request order and accepting the preserved post-compaction block even when earlier history precedes it
  • stabilize fork_startup_context_then_first_turn_diff_snapshot by waiting for the parent rollout to persist the pre-fork user turn before forking from the JSONL path
  • keep both changes scoped to flaky tests

Root cause

  • compact_resume_after_second_compaction_preserves_history combined overlapping mount_sse_once_match recorders and indexed into a synthetic request list, so matcher evaluation order could duplicate requests and skew the expected history slice
  • fork_startup_context_then_first_turn_diff_snapshot read the fork source rollout immediately after TurnComplete, but the rollout writer persists asynchronously, so the fork sometimes missed the source fork seed turn on disk

Impact

  • removes two Linux-sensitive flakes without changing runtime behavior
  • keeps the fixes limited to test setup and assertions

Validation

  • just fmt
  • just argument-comment-lint
  • cargo test -p codex-core compact_resume_after_second_compaction_preserves_history -- --nocapture
  • repeated cargo test -p codex-core compact_resume_after_second_compaction_preserves_history -- --nocapture 10x
  • cargo test -p codex-core fork_startup_context_then_first_turn_diff_snapshot -- --nocapture
  • cargo test -p codex-core (the snapshot fix passed; one unrelated failure remained in tools::js_repl::tests::js_repl_imported_local_files_can_access_repl_globals because mktemp was denied during dotslash setup)

@charley-oai charley-oai marked this pull request as ready for review March 24, 2026 06:03
@charley-oai
Copy link
Contributor Author

@codex review

Co-authored-by: Codex <noreply@openai.com>
@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai charley-oai force-pushed the codex/stabilize-second-compaction-history-test branch from 34fd7c5 to 1fb0e60 Compare March 24, 2026 06:12
Co-authored-by: Codex <noreply@openai.com>
@charley-oai charley-oai merged commit 910cf49 into main Mar 24, 2026
36 checks passed
@charley-oai charley-oai deleted the codex/stabilize-second-compaction-history-test branch March 24, 2026 17:14
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2026
@charley-oai charley-oai changed the title [codex] Stabilize second compaction history test [codex] Stabilize compact resume and fork snapshot flaky tests Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants