mirror of
https://github.com/openai/codex.git
synced 2026-10-23 08:51:54 +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:
@@ -1955,6 +1955,10 @@ pub struct ContextCompactedEvent;
|
||||
pub struct TurnCompleteEvent {
|
||||
pub turn_id: String,
|
||||
pub last_agent_message: Option<String>,
|
||||
/// Unix timestamp (in seconds) when the turn started.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(type = "number | null", optional)]
|
||||
pub started_at: Option<i64>,
|
||||
/// Unix timestamp (in seconds) when the turn completed.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(type = "number | null", optional)]
|
||||
@@ -4105,6 +4109,10 @@ pub struct Chunk {
|
||||
pub struct TurnAbortedEvent {
|
||||
pub turn_id: Option<String>,
|
||||
pub reason: TurnAbortReason,
|
||||
/// Unix timestamp (in seconds) when the turn started.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(type = "number | null", optional)]
|
||||
pub started_at: Option<i64>,
|
||||
/// Unix timestamp (in seconds) when the turn was aborted.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(type = "number | null", optional)]
|
||||
|
||||
Reference in New Issue
Block a user