[codex-analytics] add protocol-native turn timestamps

This commit is contained in:
rhan-oai
2026-04-06 13:13:44 -07:00
parent 9bb813353e
commit 6d273dd348
58 changed files with 1176 additions and 60 deletions
+18 -2
View File
@@ -9186,13 +9186,19 @@ guardian_approval = true
items,
status,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
}
}
fn turn_started_notification(thread_id: ThreadId, turn_id: &str) -> ServerNotification {
ServerNotification::TurnStarted(TurnStartedNotification {
thread_id: thread_id.to_string(),
turn: test_turn(turn_id, TurnStatus::InProgress, Vec::new()),
turn: Turn {
started_at: Some(0),
..test_turn(turn_id, TurnStatus::InProgress, Vec::new())
},
})
}
@@ -9203,7 +9209,11 @@ guardian_approval = true
) -> ServerNotification {
ServerNotification::TurnCompleted(TurnCompletedNotification {
thread_id: thread_id.to_string(),
turn: test_turn(turn_id, status, Vec::new()),
turn: Turn {
completed_at: Some(0),
duration_ms: Some(1),
..test_turn(turn_id, status, Vec::new())
},
})
}
@@ -10424,6 +10434,9 @@ guardian_approval = true
}],
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
},
Turn {
id: "turn-2".to_string(),
@@ -10444,6 +10457,9 @@ guardian_approval = true
],
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
},
],
events: Vec::new(),
+41 -1
View File
@@ -501,6 +501,7 @@ fn server_notification_thread_events(
id: String::new(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: notification.turn.id,
started_at: notification.turn.started_at,
model_context_window: None,
collaboration_mode_kind: ModeKind::default(),
}),
@@ -676,6 +677,7 @@ fn turn_snapshot_events(
id: String::new(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: turn.id.clone(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::default(),
}),
@@ -741,6 +743,8 @@ fn append_terminal_turn_events(events: &mut Vec<Event>, turn: &Turn, include_fai
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn.id.clone(),
last_agent_message: None,
completed_at: turn.completed_at,
duration_ms: turn.duration_ms,
}),
}),
TurnStatus::Interrupted => events.push(Event {
@@ -748,6 +752,8 @@ fn append_terminal_turn_events(events: &mut Vec<Event>, turn: &Turn, include_fai
msg: EventMsg::TurnAborted(TurnAbortedEvent {
turn_id: Some(turn.id.clone()),
reason: TurnAbortReason::Interrupted,
completed_at: turn.completed_at,
duration_ms: turn.duration_ms,
}),
}),
TurnStatus::Failed => {
@@ -768,6 +774,8 @@ fn append_terminal_turn_events(events: &mut Vec<Event>, turn: &Turn, include_fai
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn.id.clone(),
last_agent_message: None,
completed_at: turn.completed_at,
duration_ms: turn.duration_ms,
}),
});
}
@@ -1103,6 +1111,9 @@ mod tests {
items: Vec::new(),
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: Some(0),
duration_ms: None,
},
}),
)
@@ -1121,6 +1132,8 @@ mod tests {
};
assert_eq!(completed.turn_id, turn_id);
assert_eq!(completed.last_agent_message, None);
assert_eq!(completed.completed_at, Some(0));
assert_eq!(completed.duration_ms, None);
}
#[test]
@@ -1284,6 +1297,9 @@ mod tests {
}],
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
}],
};
@@ -1315,6 +1331,9 @@ mod tests {
items: Vec::new(),
status: TurnStatus::Interrupted,
error: None,
started_at: None,
completed_at: Some(0),
duration_ms: None,
},
}),
)
@@ -1351,6 +1370,9 @@ mod tests {
codex_error_info: Some(CodexErrorInfo::Other),
additional_details: None,
}),
started_at: None,
completed_at: Some(0),
duration_ms: None,
},
}),
)
@@ -1453,12 +1475,18 @@ mod tests {
],
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
},
Turn {
id: "turn-interrupted".to_string(),
items: Vec::new(),
status: TurnStatus::Interrupted,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
},
Turn {
id: "turn-failed".to_string(),
@@ -1469,6 +1497,9 @@ mod tests {
codex_error_info: Some(CodexErrorInfo::Other),
additional_details: None,
}),
started_at: None,
completed_at: None,
duration_ms: None,
},
],
},
@@ -1481,7 +1512,10 @@ mod tests {
assert!(matches!(events[2].msg, EventMsg::ItemCompleted(_)));
assert!(matches!(events[3].msg, EventMsg::TurnComplete(_)));
assert!(matches!(events[4].msg, EventMsg::TurnStarted(_)));
let EventMsg::TurnAborted(TurnAbortedEvent { turn_id, reason }) = &events[5].msg else {
let EventMsg::TurnAborted(TurnAbortedEvent {
turn_id, reason, ..
}) = &events[5].msg
else {
panic!("expected interrupted turn replay");
};
assert_eq!(turn_id.as_deref(), Some("turn-interrupted"));
@@ -1528,6 +1562,9 @@ mod tests {
],
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
},
/*show_raw_agent_reasoning*/ false,
);
@@ -1571,6 +1608,9 @@ mod tests {
}],
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
},
/*show_raw_agent_reasoning*/ true,
);
@@ -676,6 +676,9 @@ mod tests {
items: Vec::new(),
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: Some(0),
duration_ms: Some(1),
},
})
}
+3
View File
@@ -1287,6 +1287,9 @@ mod tests {
],
status: TurnStatus::Completed,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
}],
},
model: "gpt-5.4".to_string(),
+6
View File
@@ -5889,6 +5889,9 @@ impl ChatWidget {
items,
status,
error,
started_at,
completed_at,
duration_ms,
} = turn;
if matches!(status, TurnStatus::InProgress) {
self.last_non_retry_error = None;
@@ -5909,6 +5912,9 @@ impl ChatWidget {
items: Vec::new(),
status,
error,
started_at,
completed_at,
duration_ms,
},
},
Some(replay_kind),
@@ -93,6 +93,9 @@ async fn live_app_server_turn_completed_clears_working_status_after_answer_item(
items: Vec::new(),
status: AppServerTurnStatus::InProgress,
error: None,
started_at: Some(0),
completed_at: None,
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -132,6 +135,9 @@ async fn live_app_server_turn_completed_clears_working_status_after_answer_item(
items: Vec::new(),
status: AppServerTurnStatus::Completed,
error: None,
started_at: None,
completed_at: Some(0),
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -415,6 +421,9 @@ async fn live_app_server_failed_turn_does_not_duplicate_error_history() {
items: Vec::new(),
status: AppServerTurnStatus::InProgress,
error: None,
started_at: Some(0),
completed_at: None,
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -450,6 +459,9 @@ async fn live_app_server_failed_turn_does_not_duplicate_error_history() {
codex_error_info: None,
additional_details: None,
}),
started_at: None,
completed_at: Some(0),
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -471,6 +483,9 @@ async fn live_app_server_stream_recovery_restores_previous_status_header() {
items: Vec::new(),
status: AppServerTurnStatus::InProgress,
error: None,
started_at: Some(0),
completed_at: None,
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -525,6 +540,9 @@ async fn live_app_server_server_overloaded_error_renders_warning() {
items: Vec::new(),
status: AppServerTurnStatus::InProgress,
error: None,
started_at: Some(0),
completed_at: None,
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -618,6 +618,8 @@ async fn interrupted_turn_restore_keeps_active_mode_for_resubmission() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -1040,6 +1042,8 @@ async fn interrupt_restores_queued_messages_into_composer() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -1079,6 +1083,8 @@ async fn interrupt_prepends_queued_messages_before_existing_composer_text() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -635,6 +635,7 @@ async fn unified_exec_wait_after_final_agent_message_snapshot() {
id: "turn-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -649,6 +650,8 @@ async fn unified_exec_wait_after_final_agent_message_snapshot() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: Some("Final response.".into()),
completed_at: None,
duration_ms: None,
}),
});
@@ -667,6 +670,7 @@ async fn unified_exec_wait_before_streamed_agent_message_snapshot() {
id: "turn-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -691,6 +695,8 @@ async fn unified_exec_wait_before_streamed_agent_message_snapshot() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -756,6 +762,8 @@ async fn unified_exec_waiting_multiple_empty_snapshots() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -834,6 +842,8 @@ async fn unified_exec_non_empty_then_empty_snapshots() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -1259,6 +1269,8 @@ async fn interrupt_preserves_unified_exec_processes() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -1291,6 +1303,7 @@ async fn interrupt_preserves_unified_exec_wait_streak_snapshot() {
id: "turn-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -1304,6 +1317,8 @@ async fn interrupt_preserves_unified_exec_wait_streak_snapshot() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -1331,6 +1346,8 @@ async fn turn_complete_keeps_unified_exec_processes() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -536,6 +536,9 @@ async fn replayed_retryable_app_server_error_keeps_turn_running() {
items: Vec::new(),
status: AppServerTurnStatus::InProgress,
error: None,
started_at: Some(0),
completed_at: None,
duration_ms: None,
},
}),
Some(ReplayKind::ThreadSnapshot),
@@ -686,6 +689,9 @@ async fn live_reasoning_summary_is_not_rendered_twice_when_item_completes() {
items: Vec::new(),
status: AppServerTurnStatus::InProgress,
error: None,
started_at: Some(0),
completed_at: None,
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -731,6 +737,7 @@ async fn replayed_turn_started_does_not_mark_task_running() {
chat.replay_initial_messages(vec![EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
})]);
@@ -747,6 +754,7 @@ async fn thread_snapshot_replayed_turn_started_marks_task_running() {
id: "turn-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -771,6 +779,9 @@ async fn replayed_in_progress_turn_marks_task_running() {
items: Vec::new(),
status: AppServerTurnStatus::InProgress,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
}],
ReplayKind::ResumeInitialMessages,
);
@@ -813,6 +824,7 @@ async fn thread_snapshot_replayed_stream_recovery_restores_previous_status_heade
id: "task".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -853,6 +865,7 @@ async fn resume_replay_interrupted_reconnect_does_not_leave_stale_working_state(
chat.replay_initial_messages(vec![
EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -884,6 +897,7 @@ async fn replayed_interrupted_reconnect_footer_row_snapshot() {
chat.replay_initial_messages(vec![
EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -909,6 +923,7 @@ async fn stream_recovery_restores_previous_status_header() {
id: "task".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -34,6 +34,7 @@ async fn mcp_startup_complete_does_not_clear_running_task() {
id: "task-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -566,6 +566,8 @@ async fn plan_implementation_popup_skips_replayed_turn_complete() {
chat.replay_initial_messages(vec![EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: Some("Plan details".to_string()),
completed_at: None,
duration_ms: None,
})]);
let popup = render_bottom_popup(&chat, /*width*/ 80);
@@ -590,6 +592,8 @@ async fn plan_implementation_popup_shows_once_when_replay_precedes_live_turn_com
chat.replay_initial_messages(vec![EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: Some("Plan details".to_string()),
completed_at: None,
duration_ms: None,
})]);
let replay_popup = render_bottom_popup(&chat, /*width*/ 80);
assert!(
@@ -602,6 +606,8 @@ async fn plan_implementation_popup_shows_once_when_replay_precedes_live_turn_com
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: Some("Plan details".to_string()),
completed_at: None,
duration_ms: None,
}),
});
@@ -623,6 +629,8 @@ async fn plan_implementation_popup_shows_once_when_replay_precedes_live_turn_com
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: Some("Plan details".to_string()),
completed_at: None,
duration_ms: None,
}),
});
let duplicate_popup = render_bottom_popup(&chat, /*width*/ 80);
@@ -850,6 +858,9 @@ async fn submit_user_message_queues_while_compaction_turn_is_running() {
items: Vec::new(),
status: AppServerTurnStatus::InProgress,
error: None,
started_at: Some(0),
completed_at: None,
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -893,6 +904,9 @@ async fn submit_user_message_queues_while_compaction_turn_is_running() {
items: Vec::new(),
status: AppServerTurnStatus::Completed,
error: None,
started_at: None,
completed_at: Some(0),
duration_ms: None,
},
}),
/*replay_kind*/ None,
@@ -61,6 +61,8 @@ async fn interrupted_turn_restores_queued_messages_with_images_and_elements() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -146,6 +148,7 @@ async fn steer_rejection_queues_review_follow_up_before_existing_queued_messages
id: "turn-start".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -229,6 +232,8 @@ async fn steer_rejection_queues_review_follow_up_before_existing_queued_messages
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -248,6 +253,8 @@ async fn steer_rejection_queues_review_follow_up_before_existing_queued_messages
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-2".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -932,6 +939,8 @@ async fn replaced_turn_clears_pending_steers_but_keeps_queued_drafts() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Replaced,
completed_at: None,
duration_ms: None,
}),
});
@@ -1155,6 +1164,8 @@ async fn interrupt_exec_marks_failed_snapshot() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -1180,6 +1191,7 @@ async fn interrupted_turn_error_message_snapshot() {
id: "task-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -1191,6 +1203,8 @@ async fn interrupted_turn_error_message_snapshot() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -1217,6 +1231,7 @@ async fn interrupted_turn_pending_steers_message_snapshot() {
id: "task-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -1227,6 +1242,8 @@ async fn interrupted_turn_pending_steers_message_snapshot() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -1323,6 +1340,8 @@ async fn review_ended_keeps_unified_exec_processes() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::ReviewEnded,
completed_at: None,
duration_ms: None,
}),
});
@@ -1355,6 +1374,7 @@ async fn enter_submits_steer_while_review_is_running() {
id: "turn-start".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -1403,6 +1423,7 @@ async fn review_queues_user_messages_snapshot() {
id: "turn-start".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -97,6 +97,8 @@ async fn slash_copy_state_tracks_turn_complete_final_reply() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: Some("Final reply **markdown**".to_string()),
completed_at: None,
duration_ms: None,
}),
});
@@ -127,6 +129,8 @@ async fn slash_copy_state_tracks_plan_item_completion() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -160,6 +164,8 @@ async fn slash_copy_state_is_preserved_during_running_task() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: Some("Previous completed reply".to_string()),
completed_at: None,
duration_ms: None,
}),
});
chat.on_task_started();
@@ -179,6 +185,8 @@ async fn slash_copy_state_clears_on_thread_rollback() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: Some("Reply that will be rolled back".to_string()),
completed_at: None,
duration_ms: None,
}),
});
chat.handle_codex_event(Event {
@@ -207,6 +215,8 @@ async fn slash_copy_is_unavailable_when_legacy_agent_message_is_not_repeated_on_
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
let _ = drain_insert_history(&mut rx);
@@ -232,6 +242,7 @@ async fn slash_copy_uses_agent_message_item_when_turn_complete_omits_final_text(
id: "turn-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -248,6 +259,8 @@ async fn slash_copy_uses_agent_message_item_when_turn_complete_omits_final_text(
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
let _ = drain_insert_history(&mut rx);
@@ -277,6 +290,7 @@ async fn slash_copy_does_not_return_stale_output_after_thread_rollback() {
id: "turn-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -293,6 +307,8 @@ async fn slash_copy_does_not_return_stale_output_after_thread_rollback() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
let _ = drain_insert_history(&mut rx);
@@ -656,6 +672,7 @@ async fn compact_queues_user_messages_snapshot() {
id: "turn-start".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -73,6 +73,7 @@ async fn turn_started_uses_runtime_context_window_before_first_token_count() {
id: "turn-start".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: Some(950_000),
collaboration_mode_kind: ModeKind::Default,
}),
@@ -628,6 +629,7 @@ async fn ui_snapshots_small_heights_task_running() {
id: "task-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -661,6 +663,7 @@ async fn status_widget_and_approval_modal_snapshot() {
id: "task-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -723,6 +726,7 @@ async fn status_widget_active_snapshot() {
id: "task-1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -877,6 +881,8 @@ async fn status_line_branch_refreshes_after_turn_complete() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -895,6 +901,8 @@ async fn status_line_branch_refreshes_after_interrupt() {
msg: EventMsg::TurnAborted(codex_protocol::protocol::TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
}),
});
@@ -1120,6 +1128,7 @@ async fn multiple_agent_messages_in_single_turn_emit_multiple_headers() {
id: "s1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -1142,6 +1151,8 @@ async fn multiple_agent_messages_in_single_turn_emit_multiple_headers() {
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
@@ -1425,6 +1436,7 @@ async fn chatwidget_exec_and_status_layout_vt100_snapshot() {
id: "t1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -1477,6 +1489,7 @@ async fn chatwidget_markdown_code_blocks_vt100_snapshot() {
id: "t1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),
@@ -1551,6 +1564,8 @@ printf 'fenced within fenced\n'
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
last_agent_message: None,
completed_at: None,
duration_ms: None,
}),
});
for lines in drain_insert_history(&mut rx) {
@@ -1572,6 +1587,7 @@ async fn chatwidget_tall() {
id: "t1".into(),
msg: EventMsg::TurnStarted(TurnStartedEvent {
turn_id: "turn-1".to_string(),
started_at: None,
model_context_window: None,
collaboration_mode_kind: ModeKind::Default,
}),