Add ItemStarted/ItemCompleted events for UserInputItem (#5306)
Adds a new ItemStarted event and delivers UserMessage as the first item type (more to come). Renames `InputItem` to `UserInput` considering we're using the `Item` suffix for actual items.
This commit is contained in:
@@ -134,6 +134,14 @@ where
|
||||
wait_for_event_with_timeout(codex, predicate, Duration::from_secs(1)).await
|
||||
}
|
||||
|
||||
pub async fn wait_for_event_match<T, F>(codex: &CodexConversation, matcher: F) -> T
|
||||
where
|
||||
F: Fn(&codex_core::protocol::EventMsg) -> Option<T>,
|
||||
{
|
||||
let ev = wait_for_event(codex, |ev| matcher(ev).is_some()).await;
|
||||
matcher(&ev).unwrap()
|
||||
}
|
||||
|
||||
pub async fn wait_for_event_with_timeout<F>(
|
||||
codex: &CodexConversation,
|
||||
mut predicate: F,
|
||||
|
||||
Reference in New Issue
Block a user