fix: emit thread stop lifecycle on implicit shutdown#22482
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 190300c0ea
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 072fa9fbcf
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Why
The thread lifecycle contributor hooks from #22476 should observe every session teardown. The explicit
Op::Shutdownpath already emittedon_thread_stop, but whensubmission_loopexited because its submission channel closed, it only tore down runtime services. That meant extensions could miss the thread-stop lifecycle signal on implicit runtime shutdown.What Changed
shutdown_runtime_services(...).emit_thread_stop_lifecycle(...).Op::Shutdownwas received so the explicit path does not double-emit lifecycle events after it exits the loop.ThreadLifecycleContributor::on_thread_stopruns once with the expected thread/session stores.Testing
cargo test -p codex-core submission_loop_channel_close_emits_thread_stop_lifecycle