mirror of
https://github.com/openai/codex.git
synced 2026-10-21 17:48:44 +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:
@@ -2191,6 +2191,7 @@ mod tests {
|
||||
fn turn_complete_event(turn_id: &str) -> TurnCompleteEvent {
|
||||
TurnCompleteEvent {
|
||||
turn_id: turn_id.to_string(),
|
||||
started_at: None,
|
||||
last_agent_message: None,
|
||||
completed_at: Some(TEST_TURN_COMPLETED_AT),
|
||||
duration_ms: Some(TEST_TURN_DURATION_MS),
|
||||
@@ -2201,6 +2202,7 @@ mod tests {
|
||||
fn turn_aborted_event(turn_id: &str) -> TurnAbortedEvent {
|
||||
TurnAbortedEvent {
|
||||
turn_id: Some(turn_id.to_string()),
|
||||
started_at: None,
|
||||
reason: codex_protocol::protocol::TurnAbortReason::Interrupted,
|
||||
completed_at: Some(TEST_TURN_COMPLETED_AT),
|
||||
duration_ms: Some(TEST_TURN_DURATION_MS),
|
||||
|
||||
@@ -2268,6 +2268,7 @@ async fn thread_resume_token_usage_replay_can_belong_to_interrupted_turn() -> Re
|
||||
"type": "event_msg",
|
||||
"payload": serde_json::to_value(EventMsg::TurnAborted(TurnAbortedEvent {
|
||||
turn_id: Some(interrupted_turn_id.to_string()),
|
||||
started_at: None,
|
||||
reason: TurnAbortReason::Interrupted,
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
|
||||
Reference in New Issue
Block a user