Skip to content

fix: address flakiness in thread_resume_rejoins_running_thread_even_with_override_mismatch#12381

Merged
bolinfest merged 1 commit intomainfrom
pr12381
Feb 21, 2026
Merged

fix: address flakiness in thread_resume_rejoins_running_thread_even_with_override_mismatch#12381
bolinfest merged 1 commit intomainfrom
pr12381

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Feb 20, 2026

Why

thread/resume responses for already-running threads can be reported as Idle even while a turn is still in progress. This is caused by a timing window where the runtime watch state has not yet observed the running-thread transition, so API clients can receive stale status information at resume time.

Possibly related: #11786

What

  • Add a shared status normalization helper, resolve_thread_status, in codex-rs/app-server/src/thread_status.rs that resolves Idle/NotLoaded to Active { active_flags: [] } when an in-progress turn is known.
  • Reuse this helper across thread response paths in codex-rs/app-server/src/codex_message_processor.rs (including thread/start, thread/unarchive, thread/read, thread/resume, thread/fork, and review/thread-started notification responses).
  • In handle_pending_thread_resume_request, use both the in-memory active_turn_snapshot and the resumed rollout turns to decide whether a turn is in progress before resolving thread status for the response.
  • Extend thread_status tests to validate the new status-resolution behavior directly.

Verification

  • cargo test -p codex-app-server suite::v2::thread_resume::thread_resume_rejoins_running_thread_even_with_override_mismatch

@bolinfest bolinfest enabled auto-merge (squash) February 21, 2026 04:35
@bolinfest bolinfest disabled auto-merge February 21, 2026 04:35
@bolinfest bolinfest merged commit a73efab into main Feb 21, 2026
82 of 88 checks passed
@bolinfest bolinfest deleted the pr12381 branch February 21, 2026 04:36
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 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