Skip to content

core: make thread activity lifecycle atomic#31338

Open
winston-openai wants to merge 1 commit into
dev/winston/thread-publication-lifecyclefrom
dev/winston/thread-idle-shutdown-reservations
Open

core: make thread activity lifecycle atomic#31338
winston-openai wants to merge 1 commit into
dev/winston/thread-publication-lifecyclefrom
dev/winston/thread-idle-shutdown-reservations

Conversation

@winston-openai

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

Copy link
Copy Markdown
Contributor

Summary

  • mirror canonical submission reservations into the manager-scoped thread activity tree
  • prepare delivery before the sender yields so a fast receiver cannot leak committed activity
  • make the final idle-shutdown exclusivity check atomic with shutdown delivery preparation
  • pin removed thread incarnations until their sessions close, including every ThreadManager removal path
  • keep failed shutdown delivery fail-closed without letting cancellation reopen a terminal generation

Stack

Test plan

  • just test -p codex-core 'thread_activity::tests' 'cancelled_submission_and_idle_shutdown_release_lifecycle_reservations' 'failed_idle_shutdown_delivery_stays_closed' 'failed_explicit_shutdown_delivery_stays_closed'
  • CARGO_INCREMENTAL=0 just fix -p codex-core
  • just fmt

@winston-openai winston-openai requested a review from a team as a code owner July 7, 2026 01:51
@winston-openai winston-openai force-pushed the dev/winston/thread-idle-shutdown-reservations branch from 87933ce to c1de464 Compare July 7, 2026 02:34
@winston-openai winston-openai changed the title core: couple thread activity to submissions core: make thread activity lifecycle atomic Jul 7, 2026
@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: c1de464dcb

ℹ️ 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/thread_activity.rs
Comment thread codex-rs/core/src/thread_activity_tests.rs
@winston-openai winston-openai force-pushed the dev/winston/thread-idle-shutdown-reservations branch from c1de464 to b133fd4 Compare July 7, 2026 03:02
@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: b133fd4368

ℹ️ 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/session/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