Skip to content

app-server: deflake running thread resume tests#13047

Merged
bolinfest merged 1 commit intomainfrom
pr13047
Feb 27, 2026
Merged

app-server: deflake running thread resume tests#13047
bolinfest merged 1 commit intomainfrom
pr13047

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Feb 27, 2026

Why

CI has been intermittently failing in suite::v2::thread_resume::thread_resume_rejoins_running_thread_even_with_override_mismatch because these running-thread resume tests treated turn/started as proof that the thread was already active.

That signal is too early for this path. turn/started is emitted optimistically from turn_start. In single_client_mode, the listener skips current_turn_history tracking in codex_message_processor.rs, so running-thread resume still depends on ThreadWatchManager observing the core TurnStarted event in bespoke_event_handling.rs. If thread/resume lands in that window, the thread can still look Idle and the assertion flakes.

What

  • Add a helper in codex-rs/app-server/tests/suite/v2/thread_resume.rs that waits for thread/status/changed to report Active for the target thread.
  • Use that public v2 notification as the synchronization barrier in the four running-thread resume tests instead of relying on turn/started.

Follow-up

This PR keeps the fix at the test layer so we can remove the flake without changing server behavior. A broader runtime fix should still be considered separately, for example:

  • make turn/start eagerly transition the thread to Active so turn/started and thread/status/changed are coherent
  • or revisit the single_client_mode guard that skips current-turn tracking for running-thread resume

Testing

  • cargo test -p codex-app-server thread_resume -- --nocapture
  • for i in $(seq 1 10); do cargo test -p codex-app-server 'suite::v2::thread_resume::thread_resume_rejoins_running_thread_even_with_override_mismatch' -- --exact --nocapture; done

@bolinfest bolinfest changed the title app-server: stabilize running thread resume tests app-server: deflake running thread resume tests Feb 27, 2026
@bolinfest bolinfest enabled auto-merge (squash) February 27, 2026 19:41
@bolinfest bolinfest merged commit 66b0adb into main Feb 27, 2026
41 of 45 checks passed
@bolinfest bolinfest deleted the pr13047 branch February 27, 2026 19:47
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 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.

2 participants