mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +00:00
Move sleep items to the extension-owned lifecycle path (#33159)
## What changed - Define `SleepItem` in `codex-extension-items` and carry `clock.sleep` events through `TurnItem::Extension`. - Preserve sleep persistence, thread-history reconstruction, and the app-server's `type: "sleep"` schema while reusing the extension-owned type. ## Testing - Add serialization coverage for the `clock.sleep` extension wire shape and its protocol wrapper. - Update sleep lifecycle and thread-history tests to exercise the extension-owned item. GitOrigin-RevId: 34bb33ed9b90a09bf4744aafdb56e019c717a168
This commit is contained in:
1 parent
83a4187837
commit
5d325ba223
41 files changed
+141
-55
No files matched your search
@@ -9,6 +9,7 @@ use serde::Serialize;
|
||||
use ts_rs::TS;
|
||||
|
||||
pub mod image_generation;
|
||||
pub mod sleep;
|
||||
pub mod web_search;
|
||||
|
||||
/// Canonical extension-owned turn item carried through core lifecycle events.
|
||||
@@ -35,6 +36,9 @@ pub enum ExtensionItem {
|
||||
#[serde(rename = "image_gen.generation")]
|
||||
#[ts(rename = "image_gen.generation")]
|
||||
ImageGeneration(image_generation::ImageGenerationItem),
|
||||
#[serde(rename = "clock.sleep")]
|
||||
#[ts(rename = "clock.sleep")]
|
||||
Sleep(sleep::SleepItem),
|
||||
#[serde(rename = "web.search")]
|
||||
#[ts(rename = "web.search")]
|
||||
WebSearch(web_search::WebSearchItem),
|
||||
@@ -46,6 +50,7 @@ impl ExtensionItem {
|
||||
pub fn id(&self) -> &str {
|
||||
match self {
|
||||
Self::ImageGeneration(item) => &item.id,
|
||||
Self::Sleep(item) => &item.id,
|
||||
Self::WebSearch(item) => &item.id,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user