mirror of
https://github.com/openai/codex.git
synced 2026-10-29 00:06:55 +00:00
Include start times in terminal turn events (#32263)
## What changed - Add an optional `started_at` Unix timestamp to `TurnCompleteEvent` and `TurnAbortedEvent`. - Populate the timestamp from turn timing state when a turn completes or is aborted. - Preserve the timestamp when synthesizing interrupted fork history and when importing external sessions. ## Testing - Verify that interrupting a turn emits a `TurnAbortedEvent` with a start timestamp. GitOrigin-RevId: 75b3911b95c060e5fc1843a5e293d8fe47377186
This commit is contained in:
@@ -159,6 +159,7 @@ async fn mark_thread_completed(thread: &CodexThread) {
|
||||
turn.as_ref(),
|
||||
EventMsg::TurnComplete(TurnCompleteEvent {
|
||||
turn_id: turn.sub_id.clone(),
|
||||
started_at: None,
|
||||
last_agent_message: Some("done".to_string()),
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
@@ -178,6 +179,7 @@ async fn mark_thread_interrupted(thread: &CodexThread) {
|
||||
turn.as_ref(),
|
||||
EventMsg::TurnAborted(TurnAbortedEvent {
|
||||
turn_id: Some(turn.sub_id.clone()),
|
||||
started_at: None,
|
||||
reason: TurnAbortReason::Interrupted,
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
|
||||
@@ -349,6 +349,7 @@ async fn on_event_updates_status_from_task_started() {
|
||||
async fn on_event_updates_status_from_task_complete() {
|
||||
let status = agent_status_from_event(&EventMsg::TurnComplete(TurnCompleteEvent {
|
||||
turn_id: "turn-1".to_string(),
|
||||
started_at: None,
|
||||
last_agent_message: Some("done".to_string()),
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
@@ -373,6 +374,7 @@ async fn on_event_updates_status_from_error() {
|
||||
async fn on_event_updates_status_from_turn_aborted() {
|
||||
let status = agent_status_from_event(&EventMsg::TurnAborted(TurnAbortedEvent {
|
||||
turn_id: Some("turn-1".to_string()),
|
||||
started_at: None,
|
||||
reason: TurnAbortReason::Interrupted,
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
@@ -2025,6 +2027,7 @@ async fn multi_agent_v2_completion_ignores_dead_direct_parent() {
|
||||
tester_turn.as_ref(),
|
||||
EventMsg::TurnComplete(TurnCompleteEvent {
|
||||
turn_id: tester_turn.sub_id.clone(),
|
||||
started_at: None,
|
||||
last_agent_message: Some("done".to_string()),
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
@@ -2112,6 +2115,7 @@ async fn multi_agent_v2_completion_queues_message_for_direct_parent() {
|
||||
tester_turn.as_ref(),
|
||||
EventMsg::TurnComplete(TurnCompleteEvent {
|
||||
turn_id: tester_turn.sub_id.clone(),
|
||||
started_at: None,
|
||||
last_agent_message: Some("done".to_string()),
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
|
||||
Reference in New Issue
Block a user