Skip to content

Wire task completion into thread-idle lifecycle#24928

Merged
jif-oai merged 2 commits into
mainfrom
jif/wire-idle-invoke
May 28, 2026
Merged

Wire task completion into thread-idle lifecycle#24928
jif-oai merged 2 commits into
mainfrom
jif/wire-idle-invoke

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 28, 2026

Why

#24744 introduced the thread idle lifecycle hook so idle continuation can be owned by lifecycle contributors instead of hard-coded goal runtime plumbing. Task completion still called goal_runtime_apply(GoalRuntimeEvent::MaybeContinueIfIdle) directly, so the post-turn idle transition remained goal-specific and did not notify generic thread lifecycle contributors.

What Changed

  • Add Session::emit_thread_idle_lifecycle_if_idle() to gate idle emission on both no active turn and no queued trigger-turn mailbox work.
  • Call that helper when a task clears the active turn, replacing the direct GoalRuntimeEvent::MaybeContinueIfIdle path.
  • Cover the behavior with codex-core session tests for emitting after task completion and suppressing idle emission while trigger-turn mailbox work is pending.

Verification

  • New tests in core/src/session/tests.rs exercise the idle lifecycle emission and trigger-turn mailbox guard.

@jif-oai jif-oai requested a review from a team as a code owner May 28, 2026 15:17
@jif-oai jif-oai changed the title feat: wire idle invoke Wire task completion into thread-idle lifecycle May 28, 2026
Copy link
Copy Markdown
Contributor

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

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: 275b03b9aa

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

Comment thread codex-rs/core/src/tasks/mod.rs
Comment thread codex-rs/core/src/tasks/lifecycle.rs
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 28, 2026

@codex review

Copy link
Copy Markdown
Contributor

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

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: 77c99b53df

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

Comment thread codex-rs/core/src/tasks/mod.rs
@jif-oai jif-oai merged commit 462deb0 into main May 28, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/wire-idle-invoke branch May 28, 2026 18:05
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 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