Skip to content

feat: add thread idle lifecycle hook#24744

Merged
jif-oai merged 2 commits into
mainfrom
jif/idle-contributor
May 27, 2026
Merged

feat: add thread idle lifecycle hook#24744
jif-oai merged 2 commits into
mainfrom
jif/idle-contributor

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

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

Why

Extensions can currently observe thread start, resume, and stop, but they do not have a lifecycle point for the host to say that immediately pending thread work has drained. That makes idle follow-up behavior harder to express as extension-owned logic instead of host-specific plumbing.

This adds an explicit idle lifecycle hook so an extension can react when a thread becomes idle while the host keeps ownership of whether any submitted follow-up input starts a turn, is queued, or is ignored.

What changed

  • Added ThreadIdleInput with access to the session-scoped and thread-scoped extension stores.
  • Added a default on_thread_idle method to ThreadLifecycleContributor.
  • Re-exported ThreadIdleInput from the extension API surface.

Testing

Not run; this only extends the extension API trait surface with a default hook and exported input type.

@jif-oai jif-oai requested a review from a team as a code owner May 27, 2026 11:34
@jif-oai jif-oai changed the title feat: idle contributor feat: add thread idle lifecycle hook May 27, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 27, 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: 4f0b89380a

ℹ️ 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/ext/extension-api/src/contributors.rs
@jif-oai jif-oai merged commit d2ebb8d into main May 27, 2026
30 of 31 checks passed
@jif-oai jif-oai deleted the jif/idle-contributor branch May 27, 2026 13:17
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 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.

1 participant