mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
Make external sleep notifications lossless
This commit is contained in:
@@ -167,6 +167,7 @@ pub(crate) fn server_notification_requires_delivery(notification: &ServerNotific
|
||||
| ServerNotification::ThreadSettingsUpdated(_)
|
||||
| ServerNotification::ItemCompleted(_)
|
||||
| ServerNotification::ExternalAgentConfigImportCompleted(_)
|
||||
| ServerNotification::CurrentTimeSleep(_)
|
||||
| ServerNotification::AgentMessageDelta(_)
|
||||
| ServerNotification::PlanDelta(_)
|
||||
| ServerNotification::ReasoningSummaryTextDelta(_)
|
||||
@@ -2192,6 +2193,17 @@ mod tests {
|
||||
)
|
||||
)
|
||||
));
|
||||
assert!(event_requires_delivery(
|
||||
&InProcessServerEvent::ServerNotification(
|
||||
codex_app_server_protocol::ServerNotification::CurrentTimeSleep(
|
||||
codex_app_server_protocol::CurrentTimeSleepNotification {
|
||||
thread_id: "thread".to_string(),
|
||||
sleep_id: "sleep".to_string(),
|
||||
duration_ms: 1_000,
|
||||
},
|
||||
)
|
||||
)
|
||||
));
|
||||
assert!(!event_requires_delivery(&InProcessServerEvent::Lagged {
|
||||
skipped: 1
|
||||
}));
|
||||
|
||||
@@ -107,6 +107,7 @@ fn server_notification_requires_delivery(notification: &ServerNotification) -> b
|
||||
ServerNotification::TurnCompleted(_)
|
||||
| ServerNotification::ThreadSettingsUpdated(_)
|
||||
| ServerNotification::ExternalAgentConfigImportCompleted(_)
|
||||
| ServerNotification::CurrentTimeSleep(_)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -731,6 +732,7 @@ mod tests {
|
||||
use super::*;
|
||||
use codex_app_server_protocol::ClientInfo;
|
||||
use codex_app_server_protocol::ConfigRequirementsReadResponse;
|
||||
use codex_app_server_protocol::CurrentTimeSleepNotification;
|
||||
use codex_app_server_protocol::ExternalAgentConfigImportCompletedNotification;
|
||||
use codex_app_server_protocol::SessionSource as ApiSessionSource;
|
||||
use codex_app_server_protocol::ThreadStartParams;
|
||||
@@ -904,5 +906,12 @@ mod tests {
|
||||
},
|
||||
)
|
||||
));
|
||||
assert!(server_notification_requires_delivery(
|
||||
&ServerNotification::CurrentTimeSleep(CurrentTimeSleepNotification {
|
||||
thread_id: "thread-1".to_string(),
|
||||
sleep_id: "sleep-1".to_string(),
|
||||
duration_ms: 1_000,
|
||||
})
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user