[codex-analytics] add protocol-native turn timestamps

This commit is contained in:
rhan-oai
2026-04-02 18:52:39 -07:00
parent 0bd31dc382
commit 3d1314ca03
23 changed files with 204 additions and 4 deletions
@@ -5043,6 +5043,9 @@ pub struct ThreadNameUpdatedNotification {
pub struct TurnStartedNotification {
pub thread_id: String,
pub turn: Turn,
/// Unix timestamp (in seconds) when the turn started.
#[ts(type = "number")]
pub created_at: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
@@ -5069,6 +5072,12 @@ pub struct Usage {
pub struct TurnCompletedNotification {
pub thread_id: String,
pub turn: Turn,
/// Unix timestamp (in seconds) when the turn completed.
#[ts(type = "number")]
pub completed_at: i64,
/// Duration between turn start and completion in milliseconds, if known.
#[ts(type = "number | null")]
pub duration_ms: Option<i64>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]