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:
@@ -1177,6 +1177,7 @@ mod tests {
|
||||
id: turn_id.to_string(),
|
||||
msg: EventMsg::TurnComplete(TurnCompleteEvent {
|
||||
turn_id: turn_id.to_string(),
|
||||
started_at: None,
|
||||
last_agent_message: last_agent_message.map(str::to_string),
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
@@ -1190,6 +1191,7 @@ mod tests {
|
||||
id: turn_id.to_string(),
|
||||
msg: EventMsg::TurnAborted(TurnAbortedEvent {
|
||||
turn_id: Some(turn_id.to_string()),
|
||||
started_at: None,
|
||||
reason: TurnAbortReason::Interrupted,
|
||||
completed_at: None,
|
||||
duration_ms: None,
|
||||
|
||||
@@ -2229,6 +2229,7 @@ async fn guardian_reused_trunk_ignores_stale_prior_turn_completion() -> anyhow::
|
||||
id: "stale-turn".to_string(),
|
||||
msg: EventMsg::TurnComplete(TurnCompleteEvent {
|
||||
turn_id: "stale-turn".to_string(),
|
||||
started_at: None,
|
||||
last_agent_message: Some(
|
||||
"{\"risk_level\":\"high\",\"user_authorization\":\"low\",\"outcome\":\"deny\",\"rationale\":\"stale guardian rationale\"}"
|
||||
.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user