Skip to content

core: serialize thread turn transitions#31349

Open
winston-openai wants to merge 1 commit into
dev/winston/thread-idle-shutdown-reservationsfrom
dev/winston/thread-idle-shutdown-startup
Open

core: serialize thread turn transitions#31349
winston-openai wants to merge 1 commit into
dev/winston/thread-idle-shutdown-reservationsfrom
dev/winston/thread-idle-shutdown-startup

Conversation

@winston-openai

@winston-openai winston-openai commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • serialize turn start, abort, and finish transitions with a per-session transition lock
  • keep provisional taskless turns from accepting injected input
  • recheck trigger-turn mail after acquiring the transition lock so late mail starts a new turn

This is the fourth layer of the thread-bound idle shutdown stack and depends on #31338.

Test plan

  • CARGO_INCREMENTAL=0 just test -p codex-core 'interrupt_waits_for_idle_turn_start_to_install_task' 'task_finish_retries_trigger_mail_that_arrives_before_active_turn_clears' 'task_finish_emits_thread_idle_lifecycle_after_active_turn_clears' 'try_start_turn_if_idle_rejects_active_turn_without_injecting' 'idle_shutdown_claim_waits_for_submissions_and_blocks_automatic_turns' 'interrupting_regular_turn_waiting_on_startup_prewarm_emits_turn_aborted'
  • CARGO_INCREMENTAL=0 just fix -p codex-core
  • just fmt

Stack

@winston-openai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13385391c1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread codex-rs/core/src/tasks/mod.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant