Skip to content

core: track thread publication lifecycle#31333

Open
winston-openai wants to merge 2 commits into
dev/winston/thread-idle-shutdownfrom
dev/winston/thread-publication-lifecycle
Open

core: track thread publication lifecycle#31333
winston-openai wants to merge 2 commits into
dev/winston/thread-idle-shutdownfrom
dev/winston/thread-publication-lifecycle

Conversation

@winston-openai

Copy link
Copy Markdown
Contributor

Summary

  • register every loaded thread under its stable ThreadId in a manager-scoped tree
  • retain the parent relationship and a private incarnation generation so stale handles cannot mutate a replacement thread
  • keep child initialization active until the thread is actually published, and reject registration beneath a closing ancestor
  • prune closed thread trees leaf-to-root without time-based state

Why

The follow-up descendant-activity gate needs a durable identity tree keyed by the same thread IDs used by app-server and ChatGPT. This stage owns only registration, publication, replacement isolation, and cleanup; activity reservations and completion delivery remain in the next PR so each concurrency contract is independently reviewable.

Stack

Validation

  • CARGO_INCREMENTAL=0 just test -p codex-core registration_and_publication_preserve_thread_incarnations dropped_tree_handles_are_pruned_leaf_to_root
  • CARGO_INCREMENTAL=0 just fix -p codex-core
  • just fmt

The two focused tests passed before the final fix/format pass; tests were not rerun afterward, per repository guidance.

@winston-openai winston-openai requested a review from a team as a code owner July 7, 2026 01:20

@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: c7f986f65a

ℹ️ 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 Outdated
Comment thread codex-rs/core/src/session/session.rs Outdated
Comment thread codex-rs/core/src/session/handlers.rs
@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: a5e66c6979

ℹ️ 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_tests.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