mirror of
https://github.com/openai/codex.git
synced 2026-11-07 00:33:29 +00:00
feat: add thread idle lifecycle hook (#24744)
## 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.
This commit is contained in:
1 parent
7df8431bbd
commit
d2ebb8d8ca
3 files changed
+17
No files matched your search
@@ -18,6 +18,14 @@ pub struct ThreadResumeInput<'a> {
|
||||
pub thread_store: &'a ExtensionData,
|
||||
}
|
||||
|
||||
/// Input supplied when the host has no immediately pending thread work.
|
||||
pub struct ThreadIdleInput<'a> {
|
||||
/// Store scoped to the host session runtime.
|
||||
pub session_store: &'a ExtensionData,
|
||||
/// Store scoped to this thread runtime.
|
||||
pub thread_store: &'a ExtensionData,
|
||||
}
|
||||
|
||||
/// Input supplied when the host stops a thread runtime.
|
||||
pub struct ThreadStopInput<'a> {
|
||||
/// Store scoped to the host session runtime.
|
||||
|
||||
Reference in new issue
Block a user