diff --git a/codex-rs/app-server-client/src/lib.rs b/codex-rs/app-server-client/src/lib.rs index 8165fb3673..e136b90506 100644 --- a/codex-rs/app-server-client/src/lib.rs +++ b/codex-rs/app-server-client/src/lib.rs @@ -1130,6 +1130,8 @@ mod tests { ServerNotification::ItemCompleted(codex_app_server_protocol::ItemCompletedNotification { thread_id: "thread".to_string(), turn_id: "turn".to_string(), + started_at_ms: None, + completed_at_ms: None, item: codex_app_server_protocol::ThreadItem::AgentMessage { id: "item".to_string(), text: text.to_string(), @@ -1999,6 +2001,8 @@ mod tests { codex_app_server_protocol::ItemCompletedNotification { thread_id: "thread".to_string(), turn_id: "turn".to_string(), + started_at_ms: None, + completed_at_ms: None, item: codex_app_server_protocol::ThreadItem::AgentMessage { id: "item".to_string(), text: "hello".to_string(), diff --git a/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/codex-rs/app-server-protocol/schema/json/ServerNotification.json index 5bbd51bb9e..b5197e1734 100644 --- a/codex-rs/app-server-protocol/schema/json/ServerNotification.json +++ b/codex-rs/app-server-protocol/schema/json/ServerNotification.json @@ -1930,9 +1930,25 @@ }, "ItemCompletedNotification": { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "item": { "$ref": "#/definitions/ThreadItem" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "threadId": { "type": "string" }, @@ -2028,6 +2044,14 @@ "item": { "$ref": "#/definitions/ThreadItem" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "threadId": { "type": "string" }, @@ -3312,6 +3336,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -3354,6 +3386,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -3384,9 +3424,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -3410,6 +3474,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -3450,6 +3522,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -3478,6 +3558,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -3504,6 +3592,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -3543,6 +3639,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -3583,6 +3695,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -3631,12 +3751,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -3679,6 +3823,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -3701,6 +3861,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 35c9dc86be..278406df2a 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -9810,9 +9810,25 @@ "ItemCompletedNotification": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "item": { "$ref": "#/definitions/v2/ThreadItem" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "threadId": { "type": "string" }, @@ -9914,6 +9930,14 @@ "item": { "$ref": "#/definitions/v2/ThreadItem" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "threadId": { "type": "string" }, @@ -15045,6 +15069,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -15087,6 +15119,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/v2/CommandExecutionStatus" }, @@ -15117,9 +15157,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/v2/PatchApplyStatus" }, @@ -15143,6 +15207,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -15183,6 +15255,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/v2/McpToolCallStatus" }, @@ -15211,6 +15291,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/v2/DynamicToolCallOutputContentItem" @@ -15237,6 +15325,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/v2/DynamicToolCallStatus" }, @@ -15276,6 +15372,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -15316,6 +15428,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -15364,12 +15484,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -15412,6 +15556,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -15434,6 +15594,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 03ac3475e1..6dc06e65e2 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -6464,9 +6464,25 @@ "ItemCompletedNotification": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "item": { "$ref": "#/definitions/ThreadItem" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "threadId": { "type": "string" }, @@ -6568,6 +6584,14 @@ "item": { "$ref": "#/definitions/ThreadItem" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "threadId": { "type": "string" }, @@ -12931,6 +12955,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -12973,6 +13005,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -13003,9 +13043,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -13029,6 +13093,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -13069,6 +13141,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -13097,6 +13177,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -13123,6 +13211,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -13162,6 +13258,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -13202,6 +13314,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -13250,12 +13370,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -13298,6 +13442,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -13320,6 +13480,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json index 0831483a32..977afa7e04 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json @@ -668,6 +668,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -710,6 +718,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -740,9 +756,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -766,6 +806,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -806,6 +854,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -834,6 +890,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -860,6 +924,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -899,6 +971,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -939,6 +1027,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -987,12 +1083,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1035,6 +1155,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1057,6 +1193,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, @@ -1370,9 +1514,25 @@ } }, "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "item": { "$ref": "#/definitions/ThreadItem" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "threadId": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json index 16bfeece14..a6964b21de 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json @@ -668,6 +668,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -710,6 +718,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -740,9 +756,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -766,6 +806,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -806,6 +854,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -834,6 +890,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -860,6 +924,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -899,6 +971,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -939,6 +1027,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -987,12 +1083,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1035,6 +1155,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1057,6 +1193,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, @@ -1373,6 +1517,14 @@ "item": { "$ref": "#/definitions/ThreadItem" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when the item started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "threadId": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json index 16abcd7806..75995b7e4d 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json @@ -812,6 +812,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -854,6 +862,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -884,9 +900,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -910,6 +950,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -950,6 +998,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -978,6 +1034,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1004,6 +1068,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1043,6 +1115,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1083,6 +1171,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1131,12 +1227,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1179,6 +1299,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1201,6 +1337,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json index b5d6b139b2..5d5e01b3ae 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json @@ -1585,6 +1585,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1627,6 +1635,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1657,9 +1673,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1683,6 +1723,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1723,6 +1771,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1751,6 +1807,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1777,6 +1841,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1816,6 +1888,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1856,6 +1944,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1904,12 +2000,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1952,6 +2072,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1974,6 +2110,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json index 2f5cbb9500..07c1b149e5 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json @@ -1088,6 +1088,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1130,6 +1138,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1160,9 +1176,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1186,6 +1226,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1226,6 +1274,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1254,6 +1310,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1280,6 +1344,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1319,6 +1391,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1359,6 +1447,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1407,12 +1503,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1455,6 +1575,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1477,6 +1613,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json index b9ae59708a..e608cf06be 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json @@ -1088,6 +1088,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1130,6 +1138,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1160,9 +1176,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1186,6 +1226,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1226,6 +1274,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1254,6 +1310,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1280,6 +1344,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1319,6 +1391,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1359,6 +1447,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1407,12 +1503,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1455,6 +1575,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1477,6 +1613,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json index cda474c294..6ac2584e96 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json @@ -1088,6 +1088,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1130,6 +1138,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1160,9 +1176,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1186,6 +1226,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1226,6 +1274,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1254,6 +1310,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1280,6 +1344,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1319,6 +1391,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1359,6 +1447,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1407,12 +1503,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1455,6 +1575,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1477,6 +1613,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json index 7135a53174..b3c22ee487 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json @@ -1585,6 +1585,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1627,6 +1635,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1657,9 +1673,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1683,6 +1723,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1723,6 +1771,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1751,6 +1807,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1777,6 +1841,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1816,6 +1888,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1856,6 +1944,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1904,12 +2000,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1952,6 +2072,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1974,6 +2110,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json index e5339f4e99..09793ab1b1 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json @@ -1088,6 +1088,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1130,6 +1138,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1160,9 +1176,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1186,6 +1226,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1226,6 +1274,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1254,6 +1310,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1280,6 +1344,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1319,6 +1391,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1359,6 +1447,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1407,12 +1503,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1455,6 +1575,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1477,6 +1613,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json index 5deca9f699..9c14c062f0 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json @@ -1585,6 +1585,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1627,6 +1635,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1657,9 +1673,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1683,6 +1723,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1723,6 +1771,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1751,6 +1807,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1777,6 +1841,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1816,6 +1888,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1856,6 +1944,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1904,12 +2000,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1952,6 +2072,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1974,6 +2110,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json index 774686e46a..ffdc4de1e8 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json @@ -1088,6 +1088,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1130,6 +1138,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1160,9 +1176,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1186,6 +1226,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1226,6 +1274,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1254,6 +1310,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1280,6 +1344,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1319,6 +1391,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1359,6 +1447,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1407,12 +1503,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1455,6 +1575,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1477,6 +1613,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json index eaa3becdea..920c7c68ac 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json @@ -812,6 +812,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -854,6 +862,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -884,9 +900,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -910,6 +950,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -950,6 +998,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -978,6 +1034,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1004,6 +1068,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1043,6 +1115,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1083,6 +1171,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1131,12 +1227,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1179,6 +1299,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1201,6 +1337,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json index 64179af7e1..0ee4af9c75 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json @@ -1088,6 +1088,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -1130,6 +1138,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -1160,9 +1176,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -1186,6 +1226,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -1226,6 +1274,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -1254,6 +1310,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1280,6 +1344,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1319,6 +1391,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1359,6 +1447,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1407,12 +1503,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1455,6 +1575,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1477,6 +1613,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json index 0739fa31bc..c91aedce9e 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json @@ -812,6 +812,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -854,6 +862,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -884,9 +900,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -910,6 +950,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -950,6 +998,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -978,6 +1034,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1004,6 +1068,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1043,6 +1115,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1083,6 +1171,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1131,12 +1227,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1179,6 +1299,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1201,6 +1337,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json index bc5917ef15..12e5340ef5 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json @@ -812,6 +812,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -854,6 +862,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -884,9 +900,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -910,6 +950,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -950,6 +998,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -978,6 +1034,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1004,6 +1068,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1043,6 +1115,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1083,6 +1171,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1131,12 +1227,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1179,6 +1299,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1201,6 +1337,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json index 22ad85d906..01d3a232d8 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json @@ -812,6 +812,14 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "cwd": { "allOf": [ { @@ -854,6 +862,14 @@ ], "default": "agent" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when command execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/CommandExecutionStatus" }, @@ -884,9 +900,33 @@ }, "type": "array" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of patch application in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when patch application started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/PatchApplyStatus" }, @@ -910,6 +950,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "durationMs": { "description": "The duration of the MCP tool call in milliseconds.", "format": "int64", @@ -950,6 +998,14 @@ "server": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when MCP tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/McpToolCallStatus" }, @@ -978,6 +1034,14 @@ { "properties": { "arguments": true, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "contentItems": { "items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" @@ -1004,6 +1068,14 @@ "null" ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when dynamic tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "$ref": "#/definitions/DynamicToolCallStatus" }, @@ -1043,6 +1115,22 @@ "description": "Last known status of the target agents, when available.", "type": "object" }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the collab tool execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "description": "Unique identifier for this collab tool call.", "type": "string" @@ -1083,6 +1171,14 @@ "description": "Thread ID of the agent issuing the collab request.", "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when collab tool execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "allOf": [ { @@ -1131,12 +1227,36 @@ } ] }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of the web search execution in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, "query": { "type": "string" }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when web search execution started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "type": { "enum": [ "webSearch" @@ -1179,6 +1299,22 @@ }, { "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation completed, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "durationMs": { + "description": "The duration of image generation in milliseconds.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "id": { "type": "string" }, @@ -1201,6 +1337,14 @@ } ] }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when image generation started, if known.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, "status": { "type": "string" }, diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ItemCompletedNotification.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ItemCompletedNotification.ts index 96122204b4..4ce472a580 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ItemCompletedNotification.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ItemCompletedNotification.ts @@ -3,4 +3,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ThreadItem } from "./ThreadItem"; -export type ItemCompletedNotification = { item: ThreadItem, threadId: string, turnId: string, }; +export type ItemCompletedNotification = { item: ThreadItem, threadId: string, turnId: string, +/** + * Unix timestamp (in milliseconds) when the item started, if known. + */ +startedAtMs: bigint | null, +/** + * Unix timestamp (in milliseconds) when the item completed, if known. + */ +completedAtMs: bigint | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ItemStartedNotification.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ItemStartedNotification.ts index 5cf1e7b918..b2749920a8 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ItemStartedNotification.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ItemStartedNotification.ts @@ -3,4 +3,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ThreadItem } from "./ThreadItem"; -export type ItemStartedNotification = { item: ThreadItem, threadId: string, turnId: string, }; +export type ItemStartedNotification = { item: ThreadItem, threadId: string, turnId: string, +/** + * Unix timestamp (in milliseconds) when the item started, if known. + */ +startedAtMs: bigint | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts index f7880c9d32..cd45b4b34a 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts @@ -50,14 +50,50 @@ aggregatedOutput: string | null, * The command's exit code. */ exitCode: number | null, +/** + * Unix timestamp (in milliseconds) when command execution started, if known. + */ +startedAtMs: number | null, +/** + * Unix timestamp (in milliseconds) when command execution completed, if known. + */ +completedAtMs: number | null, /** * The duration of the command execution in milliseconds. */ -durationMs: number | null, } | { "type": "fileChange", id: string, changes: Array, status: PatchApplyStatus, } | { "type": "mcpToolCall", id: string, server: string, tool: string, status: McpToolCallStatus, arguments: JsonValue, mcpAppResourceUri?: string, result: McpToolCallResult | null, error: McpToolCallError | null, +durationMs: number | null, } | { "type": "fileChange", id: string, changes: Array, status: PatchApplyStatus, +/** + * Unix timestamp (in milliseconds) when patch application started, if known. + */ +startedAtMs: number | null, +/** + * Unix timestamp (in milliseconds) when patch application completed, if known. + */ +completedAtMs: number | null, +/** + * The duration of patch application in milliseconds. + */ +durationMs: number | null, } | { "type": "mcpToolCall", id: string, server: string, tool: string, status: McpToolCallStatus, arguments: JsonValue, mcpAppResourceUri?: string, result: McpToolCallResult | null, error: McpToolCallError | null, +/** + * Unix timestamp (in milliseconds) when MCP tool execution started, if known. + */ +startedAtMs: number | null, +/** + * Unix timestamp (in milliseconds) when MCP tool execution completed, if known. + */ +completedAtMs: number | null, /** * The duration of the MCP tool call in milliseconds. */ durationMs: number | null, } | { "type": "dynamicToolCall", id: string, namespace: string | null, tool: string, arguments: JsonValue, status: DynamicToolCallStatus, contentItems: Array | null, success: boolean | null, +/** + * Unix timestamp (in milliseconds) when dynamic tool execution started, if known. + */ +startedAtMs: number | null, +/** + * Unix timestamp (in milliseconds) when dynamic tool execution completed, if known. + */ +completedAtMs: number | null, /** * The duration of the dynamic tool call in milliseconds. */ @@ -98,4 +134,40 @@ reasoningEffort: ReasoningEffort | null, /** * Last known status of the target agents, when available. */ -agentsStates: { [key in string]?: CollabAgentState }, } | { "type": "webSearch", id: string, query: string, action: WebSearchAction | null, } | { "type": "imageView", id: string, path: AbsolutePathBuf, } | { "type": "imageGeneration", id: string, status: string, revisedPrompt: string | null, result: string, savedPath?: AbsolutePathBuf, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, }; +agentsStates: { [key in string]?: CollabAgentState }, +/** + * Unix timestamp (in milliseconds) when collab tool execution started, if known. + */ +startedAtMs: number | null, +/** + * Unix timestamp (in milliseconds) when collab tool execution completed, if known. + */ +completedAtMs: number | null, +/** + * The duration of the collab tool execution in milliseconds. + */ +durationMs: number | null, } | { "type": "webSearch", id: string, query: string, action: WebSearchAction | null, +/** + * Unix timestamp (in milliseconds) when web search execution started, if known. + */ +startedAtMs: number | null, +/** + * Unix timestamp (in milliseconds) when web search execution completed, if known. + */ +completedAtMs: number | null, +/** + * The duration of the web search execution in milliseconds. + */ +durationMs: number | null, } | { "type": "imageView", id: string, path: AbsolutePathBuf, } | { "type": "imageGeneration", id: string, status: string, revisedPrompt: string | null, result: string, savedPath?: AbsolutePathBuf, +/** + * Unix timestamp (in milliseconds) when image generation started, if known. + */ +startedAtMs: number | null, +/** + * Unix timestamp (in milliseconds) when image generation completed, if known. + */ +completedAtMs: number | null, +/** + * The duration of image generation in milliseconds. + */ +durationMs: number | null, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, } | { "type": "contextCompaction", id: string, }; diff --git a/codex-rs/app-server-protocol/src/protocol/item_builders.rs b/codex-rs/app-server-protocol/src/protocol/item_builders.rs index 546fb1b679..461e315b73 100644 --- a/codex-rs/app-server-protocol/src/protocol/item_builders.rs +++ b/codex-rs/app-server-protocol/src/protocol/item_builders.rs @@ -45,6 +45,9 @@ pub fn build_file_change_approval_request_item( id: payload.call_id.clone(), changes: convert_patch_changes(&payload.changes), status: PatchApplyStatus::InProgress, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } } @@ -53,6 +56,9 @@ pub fn build_file_change_begin_item(payload: &PatchApplyBeginEvent) -> ThreadIte id: payload.call_id.clone(), changes: convert_patch_changes(&payload.changes), status: PatchApplyStatus::InProgress, + started_at_ms: payload.started_at_ms, + completed_at_ms: None, + duration_ms: None, } } @@ -61,6 +67,9 @@ pub fn build_file_change_end_item(payload: &PatchApplyEndEvent) -> ThreadItem { id: payload.call_id.clone(), changes: convert_patch_changes(&payload.changes), status: (&payload.status).into(), + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, + duration_ms: payload.duration_ms, } } @@ -82,6 +91,8 @@ pub fn build_command_execution_approval_request_item( .collect(), aggregated_output: None, exit_code: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, } } @@ -102,6 +113,8 @@ pub fn build_command_execution_begin_item(payload: &ExecCommandBeginEvent) -> Th .collect(), aggregated_output: None, exit_code: None, + started_at_ms: payload.started_at_ms, + completed_at_ms: None, duration_ms: None, } } @@ -129,6 +142,8 @@ pub fn build_command_execution_end_item(payload: &ExecCommandEndEvent) -> Thread .collect(), aggregated_output, exit_code: Some(payload.exit_code), + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, duration_ms: Some(duration_ms), } } @@ -158,6 +173,8 @@ pub fn build_item_from_guardian_event( command_actions, aggregated_output: None, exit_code: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, }) } @@ -194,6 +211,8 @@ pub fn build_item_from_guardian_event( command_actions, aggregated_output: None, exit_code: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, }) } diff --git a/codex-rs/app-server-protocol/src/protocol/thread_history.rs b/codex-rs/app-server-protocol/src/protocol/thread_history.rs index 019c9fa83e..a0fb73aea8 100644 --- a/codex-rs/app-server-protocol/src/protocol/thread_history.rs +++ b/codex-rs/app-server-protocol/src/protocol/thread_history.rs @@ -388,6 +388,9 @@ impl ThreadHistoryBuilder { id: payload.call_id.clone(), query: String::new(), action: None, + started_at_ms: payload.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; self.upsert_item_in_current_turn(item); } @@ -397,6 +400,9 @@ impl ThreadHistoryBuilder { id: payload.call_id.clone(), query: payload.query.clone(), action: Some(WebSearchAction::from(payload.action.clone())), + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, + duration_ms: payload.duration_ms, }; self.upsert_item_in_current_turn(item); } @@ -474,6 +480,8 @@ impl ThreadHistoryBuilder { status: DynamicToolCallStatus::InProgress, content_items: None, success: None, + started_at_ms: payload.started_at_ms, + completed_at_ms: None, duration_ms: None, }; if payload.turn_id.is_empty() { @@ -498,6 +506,8 @@ impl ThreadHistoryBuilder { status, content_items: Some(convert_dynamic_tool_content_items(&payload.content_items)), success: Some(payload.success), + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, duration_ms, }; if payload.turn_id.is_empty() { @@ -521,6 +531,8 @@ impl ThreadHistoryBuilder { mcp_app_resource_uri: payload.mcp_app_resource_uri.clone(), result: None, error: None, + started_at_ms: payload.started_at_ms, + completed_at_ms: None, duration_ms: None, }; self.upsert_item_in_current_turn(item); @@ -562,6 +574,8 @@ impl ThreadHistoryBuilder { mcp_app_resource_uri: payload.mcp_app_resource_uri.clone(), result, error, + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, duration_ms, }; self.upsert_item_in_current_turn(item); @@ -582,6 +596,9 @@ impl ThreadHistoryBuilder { revised_prompt: None, result: String::new(), saved_path: None, + started_at_ms: payload.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; self.upsert_item_in_current_turn(item); } @@ -593,6 +610,9 @@ impl ThreadHistoryBuilder { revised_prompt: payload.revised_prompt.clone(), result: payload.result.clone(), saved_path: payload.saved_path.clone(), + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, + duration_ms: payload.duration_ms, }; self.upsert_item_in_current_turn(item); } @@ -611,6 +631,9 @@ impl ThreadHistoryBuilder { model: Some(payload.model.clone()), reasoning_effort: Some(payload.reasoning_effort), agents_states: HashMap::new(), + started_at_ms: payload.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; self.upsert_item_in_current_turn(item); } @@ -646,6 +669,9 @@ impl ThreadHistoryBuilder { model: Some(payload.model.clone()), reasoning_effort: Some(payload.reasoning_effort), agents_states, + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, + duration_ms: payload.duration_ms, }); } @@ -663,6 +689,9 @@ impl ThreadHistoryBuilder { model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: payload.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; self.upsert_item_in_current_turn(item); } @@ -687,6 +716,9 @@ impl ThreadHistoryBuilder { model: None, reasoning_effort: None, agents_states: [(receiver_id, received_status)].into_iter().collect(), + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, + duration_ms: payload.duration_ms, }); } @@ -708,6 +740,9 @@ impl ThreadHistoryBuilder { model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: payload.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; self.upsert_item_in_current_turn(item); } @@ -743,6 +778,9 @@ impl ThreadHistoryBuilder { model: None, reasoning_effort: None, agents_states, + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, + duration_ms: payload.duration_ms, }); } @@ -760,6 +798,9 @@ impl ThreadHistoryBuilder { model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: payload.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; self.upsert_item_in_current_turn(item); } @@ -786,6 +827,9 @@ impl ThreadHistoryBuilder { model: None, reasoning_effort: None, agents_states, + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, + duration_ms: payload.duration_ms, }); } @@ -803,6 +847,9 @@ impl ThreadHistoryBuilder { model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: payload.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; self.upsert_item_in_current_turn(item); } @@ -832,6 +879,9 @@ impl ThreadHistoryBuilder { model: None, reasoning_effort: None, agents_states, + started_at_ms: payload.started_at_ms, + completed_at_ms: payload.completed_at_ms, + duration_ms: payload.duration_ms, }); } @@ -1347,6 +1397,7 @@ mod tests { EventMsg::ItemStarted(ItemStartedEvent { thread_id, turn_id: turn_id.to_string(), + started_at_ms: None, item: CoreTurnItem::UserMessage(CoreUserMessageItem { id: "user-item-id".to_string(), content: Vec::new(), @@ -1426,6 +1477,9 @@ mod tests { revised_prompt: Some("final prompt".into()), result: "Zm9v".into(), saved_path: Some(test_path_buf("/tmp/ig_123.png").abs()), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, })), RolloutItem::EventMsg(EventMsg::TurnComplete(TurnCompleteEvent { turn_id: "turn-image".into(), @@ -1461,6 +1515,9 @@ mod tests { revised_prompt: Some("final prompt".into()), result: "Zm9v".into(), saved_path: Some(test_path_buf("/tmp/ig_123.png").abs()), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }, ], } @@ -1810,6 +1867,9 @@ mod tests { query: Some("codex".into()), queries: None, }, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }), EventMsg::ExecCommandEnd(ExecCommandEndEvent { call_id: "exec-1".into(), @@ -1829,6 +1889,8 @@ mod tests { duration: Duration::from_millis(12), formatted_output: String::new(), status: CoreExecCommandStatus::Completed, + started_at_ms: None, + completed_at_ms: None, }), EventMsg::McpToolCallEnd(McpToolCallEndEvent { call_id: "mcp-1".into(), @@ -1840,6 +1902,8 @@ mod tests { mcp_app_resource_uri: None, duration: Duration::from_millis(8), result: Err("boom".into()), + started_at_ms: None, + completed_at_ms: None, }), ]; @@ -1859,6 +1923,9 @@ mod tests { query: Some("codex".into()), queries: None, }), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ); assert_eq!( @@ -1875,6 +1942,8 @@ mod tests { }], aggregated_output: Some("hello world\n".into()), exit_code: Some(0), + started_at_ms: None, + completed_at_ms: None, duration_ms: Some(12), } ); @@ -1891,6 +1960,8 @@ mod tests { error: Some(McpToolCallError { message: "boom".into(), }), + started_at_ms: None, + completed_at_ms: None, duration_ms: Some(8), } ); @@ -1925,6 +1996,8 @@ mod tests { "ui/resourceUri": "ui://widget/lookup.html" })), }), + started_at_ms: None, + completed_at_ms: None, }), ]; @@ -1954,6 +2027,8 @@ mod tests { })), })), error: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: Some(8), } ); @@ -1981,6 +2056,7 @@ mod tests { namespace: Some("codex_app".into()), tool: "lookup_ticket".into(), arguments: serde_json::json!({"id":"ABC-123"}), + started_at_ms: None, }, ), EventMsg::DynamicToolCallResponse(DynamicToolCallResponseEvent { @@ -1995,6 +2071,8 @@ mod tests { success: true, error: None, duration: Duration::from_millis(42), + started_at_ms: None, + completed_at_ms: None, }), ]; @@ -2017,6 +2095,8 @@ mod tests { text: "Ticket is open".into(), }]), success: Some(true), + started_at_ms: None, + completed_at_ms: None, duration_ms: Some(42), } ); @@ -2053,6 +2133,8 @@ mod tests { duration: Duration::ZERO, formatted_output: String::new(), status: CoreExecCommandStatus::Declined, + started_at_ms: None, + completed_at_ms: None, }), EventMsg::PatchApplyEnd(PatchApplyEndEvent { call_id: "patch-declined".into(), @@ -2069,6 +2151,9 @@ mod tests { .into_iter() .collect(), status: CorePatchApplyStatus::Declined, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }), ]; @@ -2093,6 +2178,8 @@ mod tests { }], aggregated_output: Some("exec command rejected by user".into()), exit_code: Some(-1), + started_at_ms: None, + completed_at_ms: None, duration_ms: Some(0), } ); @@ -2106,6 +2193,9 @@ mod tests { diff: "hello\n".into(), }], status: PatchApplyStatus::Declined, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ); } @@ -2184,6 +2274,8 @@ mod tests { }], aggregated_output: None, exit_code: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, } ); @@ -2245,6 +2337,8 @@ mod tests { }], aggregated_output: None, exit_code: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, } ); @@ -2302,6 +2396,8 @@ mod tests { duration: Duration::from_millis(5), formatted_output: "done\n".into(), status: CoreExecCommandStatus::Completed, + started_at_ms: None, + completed_at_ms: None, }), EventMsg::TurnComplete(TurnCompleteEvent { turn_id: "turn-b".into(), @@ -2336,6 +2432,8 @@ mod tests { }], aggregated_output: Some("done\n".into()), exit_code: Some(0), + started_at_ms: None, + completed_at_ms: None, duration_ms: Some(5), } ); @@ -2393,6 +2491,8 @@ mod tests { duration: Duration::from_millis(5), formatted_output: "done\n".into(), status: CoreExecCommandStatus::Completed, + started_at_ms: None, + completed_at_ms: None, }), EventMsg::TurnComplete(TurnCompleteEvent { turn_id: "turn-b".into(), @@ -2454,6 +2554,7 @@ mod tests { )] .into_iter() .collect(), + started_at_ms: None, }), ]; @@ -2484,6 +2585,9 @@ mod tests { diff: "hello\n".into(), }], status: PatchApplyStatus::InProgress, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }, ] ); @@ -2549,6 +2653,9 @@ mod tests { diff: "hello\n".into(), }], status: PatchApplyStatus::InProgress, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }, ] ); @@ -2734,6 +2841,9 @@ mod tests { receiver_agent_nickname: None, receiver_agent_role: None, status: AgentStatus::Completed(None), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }), ]; @@ -2764,6 +2874,9 @@ mod tests { )] .into_iter() .collect(), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ); } @@ -2791,6 +2904,9 @@ mod tests { model: "gpt-5.4-mini".into(), reasoning_effort: codex_protocol::openai_models::ReasoningEffort::Medium, status: AgentStatus::Running, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }), ]; @@ -2821,6 +2937,9 @@ mod tests { )] .into_iter() .collect(), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ); } @@ -2847,6 +2966,7 @@ mod tests { sender_thread_id: sender, receiver_thread_id: receiver, prompt: "new task".into(), + started_at_ms: None, }, ), EventMsg::CollabAgentInteractionEnd( @@ -2858,6 +2978,9 @@ mod tests { receiver_agent_role: None, prompt: "new task".into(), status: AgentStatus::Interrupted, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }, ), ]; @@ -2889,6 +3012,9 @@ mod tests { )] .into_iter() .collect(), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ); } diff --git a/codex-rs/app-server-protocol/src/protocol/v2.rs b/codex-rs/app-server-protocol/src/protocol/v2.rs index 4669ec6cc9..1ddcdb3de5 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -5641,6 +5641,12 @@ pub enum ThreadItem { aggregated_output: Option, /// The command's exit code. exit_code: Option, + /// Unix timestamp (in milliseconds) when command execution started, if known. + #[ts(type = "number | null")] + started_at_ms: Option, + /// Unix timestamp (in milliseconds) when command execution completed, if known. + #[ts(type = "number | null")] + completed_at_ms: Option, /// The duration of the command execution in milliseconds. #[ts(type = "number | null")] duration_ms: Option, @@ -5651,6 +5657,15 @@ pub enum ThreadItem { id: String, changes: Vec, status: PatchApplyStatus, + /// Unix timestamp (in milliseconds) when patch application started, if known. + #[ts(type = "number | null")] + started_at_ms: Option, + /// Unix timestamp (in milliseconds) when patch application completed, if known. + #[ts(type = "number | null")] + completed_at_ms: Option, + /// The duration of patch application in milliseconds. + #[ts(type = "number | null")] + duration_ms: Option, }, #[serde(rename_all = "camelCase")] #[ts(rename_all = "camelCase")] @@ -5665,6 +5680,12 @@ pub enum ThreadItem { mcp_app_resource_uri: Option, result: Option>, error: Option, + /// Unix timestamp (in milliseconds) when MCP tool execution started, if known. + #[ts(type = "number | null")] + started_at_ms: Option, + /// Unix timestamp (in milliseconds) when MCP tool execution completed, if known. + #[ts(type = "number | null")] + completed_at_ms: Option, /// The duration of the MCP tool call in milliseconds. #[ts(type = "number | null")] duration_ms: Option, @@ -5679,6 +5700,12 @@ pub enum ThreadItem { status: DynamicToolCallStatus, content_items: Option>, success: Option, + /// Unix timestamp (in milliseconds) when dynamic tool execution started, if known. + #[ts(type = "number | null")] + started_at_ms: Option, + /// Unix timestamp (in milliseconds) when dynamic tool execution completed, if known. + #[ts(type = "number | null")] + completed_at_ms: Option, /// The duration of the dynamic tool call in milliseconds. #[ts(type = "number | null")] duration_ms: Option, @@ -5705,6 +5732,15 @@ pub enum ThreadItem { reasoning_effort: Option, /// Last known status of the target agents, when available. agents_states: HashMap, + /// Unix timestamp (in milliseconds) when collab tool execution started, if known. + #[ts(type = "number | null")] + started_at_ms: Option, + /// Unix timestamp (in milliseconds) when collab tool execution completed, if known. + #[ts(type = "number | null")] + completed_at_ms: Option, + /// The duration of the collab tool execution in milliseconds. + #[ts(type = "number | null")] + duration_ms: Option, }, #[serde(rename_all = "camelCase")] #[ts(rename_all = "camelCase")] @@ -5712,6 +5748,15 @@ pub enum ThreadItem { id: String, query: String, action: Option, + /// Unix timestamp (in milliseconds) when web search execution started, if known. + #[ts(type = "number | null")] + started_at_ms: Option, + /// Unix timestamp (in milliseconds) when web search execution completed, if known. + #[ts(type = "number | null")] + completed_at_ms: Option, + /// The duration of the web search execution in milliseconds. + #[ts(type = "number | null")] + duration_ms: Option, }, #[serde(rename_all = "camelCase")] #[ts(rename_all = "camelCase")] @@ -5726,6 +5771,15 @@ pub enum ThreadItem { #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] saved_path: Option, + /// Unix timestamp (in milliseconds) when image generation started, if known. + #[ts(type = "number | null")] + started_at_ms: Option, + /// Unix timestamp (in milliseconds) when image generation completed, if known. + #[ts(type = "number | null")] + completed_at_ms: Option, + /// The duration of image generation in milliseconds. + #[ts(type = "number | null")] + duration_ms: Option, }, #[serde(rename_all = "camelCase")] #[ts(rename_all = "camelCase")] @@ -6190,6 +6244,9 @@ impl From for ThreadItem { id: search.id, query: search.query, action: Some(WebSearchAction::from(search.action)), + started_at_ms: search.started_at_ms, + completed_at_ms: search.completed_at_ms, + duration_ms: search.duration_ms, }, CoreTurnItem::ImageGeneration(image) => ThreadItem::ImageGeneration { id: image.id, @@ -6197,6 +6254,9 @@ impl From for ThreadItem { revised_prompt: image.revised_prompt, result: image.result, saved_path: image.saved_path, + started_at_ms: image.started_at_ms, + completed_at_ms: image.completed_at_ms, + duration_ms: image.duration_ms, }, CoreTurnItem::ContextCompaction(compaction) => { ThreadItem::ContextCompaction { id: compaction.id } @@ -6593,6 +6653,8 @@ pub struct ItemStartedNotification { pub item: ThreadItem, pub thread_id: String, pub turn_id: String, + /// Unix timestamp (in milliseconds) when the item started, if known. + pub started_at_ms: Option, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] @@ -6655,6 +6717,10 @@ pub struct ItemCompletedNotification { pub item: ThreadItem, pub thread_id: String, pub turn_id: String, + /// Unix timestamp (in milliseconds) when the item started, if known. + pub started_at_ms: Option, + /// Unix timestamp (in milliseconds) when the item completed, if known. + pub completed_at_ms: Option, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] @@ -10071,6 +10137,9 @@ mod tests { query: Some("docs".to_string()), queries: None, }, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }); assert_eq!( @@ -10082,6 +10151,9 @@ mod tests { query: Some("docs".to_string()), queries: None, }), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ); } diff --git a/codex-rs/app-server/src/bespoke_event_handling.rs b/codex-rs/app-server/src/bespoke_event_handling.rs index 061d94ee91..f95df9fb6e 100644 --- a/codex-rs/app-server/src/bespoke_event_handling.rs +++ b/codex-rs/app-server/src/bespoke_event_handling.rs @@ -628,6 +628,7 @@ pub(crate) async fn apply_bespoke_event_handling( let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1004,11 +1005,14 @@ pub(crate) async fn apply_bespoke_event_handling( status: DynamicToolCallStatus::InProgress, content_items: None, success: None, + started_at_ms: request.started_at_ms, + completed_at_ms: None, duration_ms: None, }; let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1076,11 +1080,15 @@ pub(crate) async fn apply_bespoke_event_handling( .collect(), ), success: Some(response.success), + started_at_ms: response.started_at_ms, + completed_at_ms: response.completed_at_ms, duration_ms, }; let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: response.turn_id, + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1122,10 +1130,14 @@ pub(crate) async fn apply_bespoke_event_handling( model: Some(begin_event.model), reasoning_effort: Some(begin_event.reasoning_effort), agents_states: HashMap::new(), + started_at_ms: begin_event.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1161,10 +1173,15 @@ pub(crate) async fn apply_bespoke_event_handling( model: Some(end_event.model), reasoning_effort: Some(end_event.reasoning_effort), agents_states, + started_at_ms: end_event.started_at_ms, + completed_at_ms: end_event.completed_at_ms, + duration_ms: end_event.duration_ms, }; let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1183,10 +1200,14 @@ pub(crate) async fn apply_bespoke_event_handling( model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: begin_event.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1211,10 +1232,15 @@ pub(crate) async fn apply_bespoke_event_handling( model: None, reasoning_effort: None, agents_states: [(receiver_id, received_status)].into_iter().collect(), + started_at_ms: end_event.started_at_ms, + completed_at_ms: end_event.completed_at_ms, + duration_ms: end_event.duration_ms, }; let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1237,10 +1263,14 @@ pub(crate) async fn apply_bespoke_event_handling( model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: begin_event.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1275,10 +1305,15 @@ pub(crate) async fn apply_bespoke_event_handling( model: None, reasoning_effort: None, agents_states, + started_at_ms: end_event.started_at_ms, + completed_at_ms: end_event.completed_at_ms, + duration_ms: end_event.duration_ms, }; let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1296,10 +1331,14 @@ pub(crate) async fn apply_bespoke_event_handling( model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: begin_event.started_at_ms, + completed_at_ms: None, + duration_ms: None, }; let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1338,10 +1377,15 @@ pub(crate) async fn apply_bespoke_event_handling( model: None, reasoning_effort: None, agents_states, + started_at_ms: end_event.started_at_ms, + completed_at_ms: end_event.completed_at_ms, + duration_ms: end_event.duration_ms, }; let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1353,6 +1397,7 @@ pub(crate) async fn apply_bespoke_event_handling( let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1364,6 +1409,8 @@ pub(crate) async fn apply_bespoke_event_handling( let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1528,6 +1575,7 @@ pub(crate) async fn apply_bespoke_event_handling( let started = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item: item.clone(), }; outgoing @@ -1536,6 +1584,8 @@ pub(crate) async fn apply_bespoke_event_handling( let completed = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1553,6 +1603,7 @@ pub(crate) async fn apply_bespoke_event_handling( let started = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item: item.clone(), }; outgoing @@ -1561,6 +1612,8 @@ pub(crate) async fn apply_bespoke_event_handling( let completed = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1572,6 +1625,7 @@ pub(crate) async fn apply_bespoke_event_handling( let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: item_started_event.started_at_ms, item, }; outgoing @@ -1583,6 +1637,8 @@ pub(crate) async fn apply_bespoke_event_handling( let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: item_completed_event.started_at_ms, + completed_at_ms: item_completed_event.completed_at_ms, item, }; outgoing @@ -1625,6 +1681,7 @@ pub(crate) async fn apply_bespoke_event_handling( let started = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item: item.clone(), }; outgoing @@ -1633,6 +1690,8 @@ pub(crate) async fn apply_bespoke_event_handling( let completed = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -1674,6 +1733,7 @@ pub(crate) async fn apply_bespoke_event_handling( let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1745,11 +1805,14 @@ pub(crate) async fn apply_bespoke_event_handling( command_actions, aggregated_output: None, exit_code: None, + started_at_ms: exec_command_begin_event.started_at_ms, + completed_at_ms: None, duration_ms: None, }; let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, item, }; outgoing @@ -1838,6 +1901,8 @@ pub(crate) async fn apply_bespoke_event_handling( let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: event_turn_id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -2111,6 +2176,8 @@ async fn complete_file_change_item( let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id, + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -2141,6 +2208,7 @@ async fn start_command_execution_item( let notification = ItemStartedNotification { thread_id: conversation_id.to_string(), turn_id, + started_at_ms: None, item: ThreadItem::CommandExecution { id: item_id, command, @@ -2151,6 +2219,8 @@ async fn start_command_execution_item( command_actions, aggregated_output: None, exit_code: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, }, }; @@ -2195,11 +2265,15 @@ async fn complete_command_execution_item( command_actions, aggregated_output: None, exit_code: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, }; let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id, + started_at_ms: None, + completed_at_ms: None, item, }; outgoing @@ -2257,6 +2331,8 @@ pub(crate) async fn maybe_emit_hook_prompt_item_completed( let notification = ItemCompletedNotification { thread_id: conversation_id.to_string(), turn_id: turn_id.to_string(), + started_at_ms: None, + completed_at_ms: None, item: ThreadItem::HookPrompt { id: hook_prompt.id, fragments: hook_prompt @@ -2856,6 +2932,9 @@ async fn on_file_change_request_approval_response( id: item_id.clone(), changes, status, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }, event_turn_id.clone(), &outgoing, @@ -3013,6 +3092,9 @@ fn collab_resume_begin_item( model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: begin_event.started_at_ms, + completed_at_ms: None, + duration_ms: None, } } @@ -3039,6 +3121,9 @@ fn collab_resume_end_item(end_event: codex_protocol::protocol::CollabResumeEndEv model: None, reasoning_effort: None, agents_states, + started_at_ms: end_event.started_at_ms, + completed_at_ms: end_event.completed_at_ms, + duration_ms: end_event.duration_ms, } } @@ -3057,11 +3142,14 @@ async fn construct_mcp_tool_call_notification( mcp_app_resource_uri: begin_event.mcp_app_resource_uri, result: None, error: None, + started_at_ms: begin_event.started_at_ms, + completed_at_ms: None, duration_ms: None, }; ItemStartedNotification { thread_id, turn_id, + started_at_ms: None, item, } } @@ -3105,11 +3193,15 @@ async fn construct_mcp_tool_call_end_notification( mcp_app_resource_uri: end_event.mcp_app_resource_uri, result, error, + started_at_ms: end_event.started_at_ms, + completed_at_ms: end_event.completed_at_ms, duration_ms, }; ItemCompletedNotification { thread_id, turn_id, + started_at_ms: None, + completed_at_ms: None, item, } } @@ -3478,6 +3570,8 @@ mod tests { command_actions: completion_item.command_actions.clone(), aggregated_output: None, exit_code: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, } ); @@ -4148,6 +4242,7 @@ mod tests { receiver_thread_id: ThreadId::new(), receiver_agent_nickname: None, receiver_agent_role: None, + started_at_ms: None, }; let item = collab_resume_begin_item(event.clone()); @@ -4161,6 +4256,9 @@ mod tests { model: None, reasoning_effort: None, agents_states: HashMap::new(), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }; assert_eq!(item, expected); } @@ -4174,6 +4272,9 @@ mod tests { receiver_agent_nickname: None, receiver_agent_role: None, status: codex_protocol::protocol::AgentStatus::NotFound, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }; let item = collab_resume_end_item(event.clone()); @@ -4193,6 +4294,9 @@ mod tests { )] .into_iter() .collect(), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }; assert_eq!(item, expected); } @@ -4582,6 +4686,7 @@ mod tests { arguments: Some(serde_json::json!({"server": ""})), }, mcp_app_resource_uri: Some("ui://widget/list-resources.html".to_string()), + started_at_ms: None, }; let thread_id = ThreadId::new().to_string(); @@ -4596,6 +4701,7 @@ mod tests { let expected = ItemStartedNotification { thread_id, turn_id, + started_at_ms: None, item: ThreadItem::McpToolCall { id: begin_event.call_id, server: begin_event.invocation.server, @@ -4605,6 +4711,8 @@ mod tests { mcp_app_resource_uri: Some("ui://widget/list-resources.html".to_string()), result: None, error: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, }, }; @@ -4747,6 +4855,7 @@ mod tests { arguments: None, }, mcp_app_resource_uri: None, + started_at_ms: None, }; let thread_id = ThreadId::new().to_string(); @@ -4761,6 +4870,7 @@ mod tests { let expected = ItemStartedNotification { thread_id, turn_id, + started_at_ms: None, item: ThreadItem::McpToolCall { id: begin_event.call_id, server: begin_event.invocation.server, @@ -4770,6 +4880,8 @@ mod tests { mcp_app_resource_uri: None, result: None, error: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: None, }, }; @@ -4802,6 +4914,8 @@ mod tests { mcp_app_resource_uri: Some("ui://widget/list-resources.html".to_string()), duration: Duration::from_nanos(92708), result: Ok(result), + started_at_ms: None, + completed_at_ms: None, }; let thread_id = ThreadId::new().to_string(); @@ -4816,6 +4930,8 @@ mod tests { let expected = ItemCompletedNotification { thread_id, turn_id, + started_at_ms: None, + completed_at_ms: None, item: ThreadItem::McpToolCall { id: end_event.call_id, server: end_event.invocation.server, @@ -4831,6 +4947,8 @@ mod tests { })), })), error: None, + started_at_ms: None, + completed_at_ms: None, duration_ms: Some(0), }, }; @@ -4850,6 +4968,8 @@ mod tests { mcp_app_resource_uri: None, duration: Duration::from_millis(1), result: Err("boom".to_string()), + started_at_ms: None, + completed_at_ms: None, }; let thread_id = ThreadId::new().to_string(); @@ -4864,6 +4984,8 @@ mod tests { let expected = ItemCompletedNotification { thread_id, turn_id, + started_at_ms: None, + completed_at_ms: None, item: ThreadItem::McpToolCall { id: end_event.call_id, server: end_event.invocation.server, @@ -4875,6 +4997,8 @@ mod tests { error: Some(McpToolCallError { message: "boom".to_string(), }), + started_at_ms: None, + completed_at_ms: None, duration_ms: Some(1), }, }; diff --git a/codex-rs/app-server/tests/suite/v2/dynamic_tools.rs b/codex-rs/app-server/tests/suite/v2/dynamic_tools.rs index 7ee21a2068..7b8344e822 100644 --- a/codex-rs/app-server/tests/suite/v2/dynamic_tools.rs +++ b/codex-rs/app-server/tests/suite/v2/dynamic_tools.rs @@ -333,6 +333,8 @@ async fn dynamic_tool_call_round_trip_sends_text_content_items_to_model() -> Res status, content_items, success, + started_at_ms, + completed_at_ms, duration_ms, } = started.item else { @@ -345,6 +347,8 @@ async fn dynamic_tool_call_round_trip_sends_text_content_items_to_model() -> Res assert_eq!(status, DynamicToolCallStatus::InProgress); assert_eq!(content_items, None); assert_eq!(success, None); + assert!(started_at_ms.is_some()); + assert_eq!(completed_at_ms, None); assert_eq!(duration_ms, None); // Read the tool call request from the app server. @@ -389,6 +393,8 @@ async fn dynamic_tool_call_round_trip_sends_text_content_items_to_model() -> Res status, content_items, success, + started_at_ms, + completed_at_ms, duration_ms, } = completed.item else { @@ -406,6 +412,8 @@ async fn dynamic_tool_call_round_trip_sends_text_content_items_to_model() -> Res }]) ); assert_eq!(success, Some(true)); + assert!(started_at_ms.is_some()); + assert!(completed_at_ms.is_some()); assert!(duration_ms.is_some()); timeout( diff --git a/codex-rs/app-server/tests/suite/v2/thread_resume.rs b/codex-rs/app-server/tests/suite/v2/thread_resume.rs index d9f5f039de..7d2b295d33 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_resume.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_resume.rs @@ -2193,16 +2193,30 @@ async fn thread_resume_replays_pending_file_change_request_approval() -> Result< }) .await??; let expected_readme_path = workspace.join("README.md"); - let expected_file_change = ThreadItem::FileChange { - id: "patch-call".to_string(), - changes: vec![codex_app_server_protocol::FileUpdateChange { + let ThreadItem::FileChange { + id, + changes, + status, + started_at_ms, + completed_at_ms, + duration_ms, + } = original_started + else { + unreachable!("loop ensures we break on file change items"); + }; + assert_eq!(id, "patch-call"); + assert_eq!( + changes, + vec![codex_app_server_protocol::FileUpdateChange { path: expected_readme_path.to_string_lossy().into_owned(), kind: PatchChangeKind::Add, diff: "new line\n".to_string(), - }], - status: PatchApplyStatus::InProgress, - }; - assert_eq!(original_started, expected_file_change); + }] + ); + assert_eq!(status, PatchApplyStatus::InProgress); + assert!(started_at_ms.is_some()); + assert_eq!(completed_at_ms, None); + assert_eq!(duration_ms, None); let original_request = timeout( DEFAULT_READ_TIMEOUT, diff --git a/codex-rs/app-server/tests/suite/v2/turn_start.rs b/codex-rs/app-server/tests/suite/v2/turn_start.rs index 3ff04d5022..700b636ae5 100644 --- a/codex-rs/app-server/tests/suite/v2/turn_start.rs +++ b/codex-rs/app-server/tests/suite/v2/turn_start.rs @@ -2175,6 +2175,7 @@ async fn turn_start_file_change_approval_v2() -> Result<()> { ref id, status, ref changes, + .. } = started_file_change else { unreachable!("loop ensures we break on file change items"); @@ -2632,20 +2633,35 @@ async fn turn_start_emits_spawn_agent_item_with_model_metadata_v2() -> Result<() } }) .await??; - assert_eq!( - spawn_started, - ThreadItem::CollabAgentToolCall { - id: SPAWN_CALL_ID.to_string(), - tool: CollabAgentTool::SpawnAgent, - status: CollabAgentToolCallStatus::InProgress, - sender_thread_id: thread.id.clone(), - receiver_thread_ids: Vec::new(), - prompt: Some(CHILD_PROMPT.to_string()), - model: Some(REQUESTED_MODEL.to_string()), - reasoning_effort: Some(REQUESTED_REASONING_EFFORT), - agents_states: HashMap::new(), - } - ); + let ThreadItem::CollabAgentToolCall { + id, + tool, + status, + sender_thread_id, + receiver_thread_ids, + prompt, + model, + reasoning_effort, + agents_states, + started_at_ms, + completed_at_ms, + duration_ms, + } = spawn_started + else { + panic!("expected collab agent tool call item"); + }; + assert_eq!(id, SPAWN_CALL_ID); + assert_eq!(tool, CollabAgentTool::SpawnAgent); + assert_eq!(status, CollabAgentToolCallStatus::InProgress); + assert_eq!(sender_thread_id, thread.id); + assert_eq!(receiver_thread_ids, Vec::::new()); + assert_eq!(prompt.as_deref(), Some(CHILD_PROMPT)); + assert_eq!(model.as_deref(), Some(REQUESTED_MODEL)); + assert_eq!(reasoning_effort, Some(REQUESTED_REASONING_EFFORT)); + assert_eq!(agents_states, HashMap::new()); + assert!(started_at_ms.is_some()); + assert_eq!(completed_at_ms, None); + assert_eq!(duration_ms, None); let spawn_completed = timeout(DEFAULT_READ_TIMEOUT, async { loop { @@ -2672,6 +2688,9 @@ async fn turn_start_emits_spawn_agent_item_with_model_metadata_v2() -> Result<() model, reasoning_effort, agents_states, + started_at_ms, + completed_at_ms, + duration_ms, } = spawn_completed else { unreachable!("loop ensures we break on collab agent tool call items"); @@ -2683,6 +2702,9 @@ async fn turn_start_emits_spawn_agent_item_with_model_metadata_v2() -> Result<() assert_eq!(id, SPAWN_CALL_ID); assert_eq!(tool, CollabAgentTool::SpawnAgent); assert_eq!(status, CollabAgentToolCallStatus::Completed); + assert!(started_at_ms.is_some()); + assert!(completed_at_ms.is_some()); + assert!(duration_ms.is_some()); assert_eq!(sender_thread_id, thread.id); assert_eq!(receiver_thread_ids, vec![receiver_thread_id.clone()]); assert_eq!(prompt, Some(CHILD_PROMPT.to_string())); @@ -2856,6 +2878,9 @@ config_file = "./custom-role.toml" model, reasoning_effort, agents_states, + started_at_ms, + completed_at_ms, + duration_ms, } = spawn_completed else { unreachable!("loop ensures we break on collab agent tool call items"); @@ -2867,6 +2892,9 @@ config_file = "./custom-role.toml" assert_eq!(id, SPAWN_CALL_ID); assert_eq!(tool, CollabAgentTool::SpawnAgent); assert_eq!(status, CollabAgentToolCallStatus::Completed); + assert!(started_at_ms.is_some()); + assert!(completed_at_ms.is_some()); + assert!(duration_ms.is_some()); assert_eq!(sender_thread_id, thread.id); assert_eq!(receiver_thread_ids, vec![receiver_thread_id.clone()]); assert_eq!(prompt, Some(CHILD_PROMPT.to_string())); @@ -3174,6 +3202,7 @@ async fn turn_start_file_change_approval_decline_v2() -> Result<()> { ref id, status, ref changes, + .. } = started_file_change else { unreachable!("loop ensures we break on file change items"); diff --git a/codex-rs/core/src/event_mapping.rs b/codex-rs/core/src/event_mapping.rs index e7c79e6dd2..0af0aec0ea 100644 --- a/codex-rs/core/src/event_mapping.rs +++ b/codex-rs/core/src/event_mapping.rs @@ -188,6 +188,9 @@ pub fn parse_turn_item(item: &ResponseItem) -> Option { id: id.clone().unwrap_or_default(), query, action, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, })) } ResponseItem::ImageGenerationCall { @@ -202,6 +205,9 @@ pub fn parse_turn_item(item: &ResponseItem) -> Option { revised_prompt: revised_prompt.clone(), result: result.clone(), saved_path: None, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }, )), _ => None, diff --git a/codex-rs/core/src/event_mapping_tests.rs b/codex-rs/core/src/event_mapping_tests.rs index 85e7034405..cac92ad60a 100644 --- a/codex-rs/core/src/event_mapping_tests.rs +++ b/codex-rs/core/src/event_mapping_tests.rs @@ -413,6 +413,9 @@ fn parses_web_search_call() { query: Some("weather".to_string()), queries: None, }, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ), other => panic!("expected TurnItem::WebSearch, got {other:?}"), @@ -440,6 +443,9 @@ fn parses_web_search_open_page_call() { action: WebSearchAction::OpenPage { url: Some("https://example.com".to_string()), }, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ), other => panic!("expected TurnItem::WebSearch, got {other:?}"), @@ -469,6 +475,9 @@ fn parses_web_search_find_in_page_call() { url: Some("https://example.com".to_string()), pattern: Some("needle".to_string()), }, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ), other => panic!("expected TurnItem::WebSearch, got {other:?}"), @@ -491,6 +500,9 @@ fn parses_partial_web_search_call_without_action_as_other() { id: "ws_partial".to_string(), query: String::new(), action: WebSearchAction::Other, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, } ), other => panic!("expected TurnItem::WebSearch, got {other:?}"), diff --git a/codex-rs/core/src/mcp_tool_call.rs b/codex-rs/core/src/mcp_tool_call.rs index c93ab296b1..12ef03de4c 100644 --- a/codex-rs/core/src/mcp_tool_call.rs +++ b/codex-rs/core/src/mcp_tool_call.rs @@ -33,6 +33,7 @@ use crate::session::session::Session; use crate::session::turn_context::TurnContext; use crate::tools::hook_names::HookToolName; use crate::tools::sandboxing::PermissionRequestPayload; +use crate::turn_timing::now_unix_timestamp_ms; use codex_analytics::AppInvocation; use codex_analytics::InvocationType; use codex_analytics::build_track_events_context; @@ -184,6 +185,7 @@ pub(crate) async fn handle_mcp_tool_call( call_id: call_id.clone(), invocation: invocation.clone(), mcp_app_resource_uri: mcp_app_resource_uri.clone(), + started_at_ms: None, }); notify_mcp_tool_call_event(sess.as_ref(), turn_context.as_ref(), tool_call_begin_event).await; @@ -312,6 +314,7 @@ async fn handle_approved_mcp_tool_call( .map(str::to_string); let start = Instant::now(); + let started_at_ms = now_unix_timestamp_ms(); let rewrite = rewrite_mcp_tool_arguments_for_openai_files( sess, turn_context, @@ -356,10 +359,13 @@ async fn handle_approved_mcp_tool_call( tracing::warn!("MCP tool call error: {error:?}"); } let duration = start.elapsed(); + let completed_at_ms = now_unix_timestamp_ms(); let tool_call_end_event = EventMsg::McpToolCallEnd(McpToolCallEndEvent { call_id: call_id.to_string(), invocation, mcp_app_resource_uri, + started_at_ms: Some(started_at_ms), + completed_at_ms: Some(completed_at_ms), duration, result: result.clone(), }); @@ -1849,6 +1855,7 @@ async fn notify_mcp_tool_call_skip( call_id: call_id.to_string(), invocation: invocation.clone(), mcp_app_resource_uri: mcp_app_resource_uri.clone(), + started_at_ms: None, }); notify_mcp_tool_call_event(sess, turn_context, tool_call_begin_event).await; } @@ -1859,6 +1866,8 @@ async fn notify_mcp_tool_call_skip( mcp_app_resource_uri, duration: Duration::ZERO, result: Err(message.clone()), + started_at_ms: None, + completed_at_ms: None, }); notify_mcp_tool_call_event(sess, turn_context, tool_call_end_event).await; Err(message) diff --git a/codex-rs/core/src/session/mod.rs b/codex-rs/core/src/session/mod.rs index 415b89c0de..f52b2f9231 100644 --- a/codex-rs/core/src/session/mod.rs +++ b/codex-rs/core/src/session/mod.rs @@ -297,6 +297,7 @@ use crate::tools::network_approval::build_network_policy_decider; use crate::tools::parallel::ToolCallRuntime; use crate::tools::sandboxing::ApprovalStore; use crate::turn_timing::TurnTimingState; +use crate::turn_timing::now_unix_timestamp_ms; use crate::turn_timing::record_turn_ttfm_metric; use crate::unified_exec::UnifiedExecProcessManager; use crate::windows_sandbox::WindowsSandboxLevelExt; @@ -1610,12 +1611,20 @@ impl Session { } pub(crate) async fn emit_turn_item_started(&self, turn_context: &TurnContext, item: &TurnItem) { + let started_at_ms = now_unix_timestamp_ms(); + self.turn_item_started_at_ms + .lock() + .await + .insert(item.id(), started_at_ms); + let mut item = item.clone(); + item.set_started_at_ms(started_at_ms); self.send_event( turn_context, EventMsg::ItemStarted(ItemStartedEvent { thread_id: self.conversation_id, turn_id: turn_context.sub_id.clone(), - item: item.clone(), + started_at_ms: Some(started_at_ms), + item, }), ) .await; @@ -1624,14 +1633,19 @@ impl Session { pub(crate) async fn emit_turn_item_completed( &self, turn_context: &TurnContext, - item: TurnItem, + mut item: TurnItem, ) { record_turn_ttfm_metric(turn_context, &item).await; + let started_at_ms = self.turn_item_started_at_ms.lock().await.remove(&item.id()); + let completed_at_ms = now_unix_timestamp_ms(); + item.set_completed_timing_ms(started_at_ms, completed_at_ms); self.send_event( turn_context, EventMsg::ItemCompleted(ItemCompletedEvent { thread_id: self.conversation_id, turn_id: turn_context.sub_id.clone(), + started_at_ms, + completed_at_ms: Some(completed_at_ms), item, }), ) diff --git a/codex-rs/core/src/session/session.rs b/codex-rs/core/src/session/session.rs index 03849f7e07..a16bc9cdcf 100644 --- a/codex-rs/core/src/session/session.rs +++ b/codex-rs/core/src/session/session.rs @@ -22,6 +22,8 @@ pub(crate) struct Session { pub(super) pending_mcp_server_refresh_config: Mutex>, pub(crate) conversation: Arc, pub(crate) active_turn: Mutex>, + /// Native start timestamps for turn items that have started but not completed yet. + pub(super) turn_item_started_at_ms: Mutex>, pub(super) mailbox: Mailbox, pub(super) mailbox_rx: Mutex, pub(super) idle_pending_input: Mutex>, // TODO (jif) merge with mailbox! @@ -860,6 +862,7 @@ impl Session { pending_mcp_server_refresh_config: Mutex::new(None), conversation: Arc::new(RealtimeConversationManager::new()), active_turn: Mutex::new(None), + turn_item_started_at_ms: Mutex::new(HashMap::new()), mailbox, mailbox_rx: Mutex::new(mailbox_rx), idle_pending_input: Mutex::new(Vec::new()), diff --git a/codex-rs/core/src/session/tests.rs b/codex-rs/core/src/session/tests.rs index 3062f8f6f4..3d26058b28 100644 --- a/codex-rs/core/src/session/tests.rs +++ b/codex-rs/core/src/session/tests.rs @@ -3561,6 +3561,7 @@ pub(crate) async fn make_session_and_context() -> (Session, TurnContext) { pending_mcp_server_refresh_config: Mutex::new(None), conversation: Arc::new(RealtimeConversationManager::new()), active_turn: Mutex::new(None), + turn_item_started_at_ms: Mutex::new(HashMap::new()), mailbox, mailbox_rx: Mutex::new(mailbox_rx), idle_pending_input: Mutex::new(Vec::new()), @@ -4955,6 +4956,7 @@ where pending_mcp_server_refresh_config: Mutex::new(None), conversation: Arc::new(RealtimeConversationManager::new()), active_turn: Mutex::new(None), + turn_item_started_at_ms: Mutex::new(HashMap::new()), mailbox, mailbox_rx: Mutex::new(mailbox_rx), idle_pending_input: Mutex::new(Vec::new()), diff --git a/codex-rs/core/src/tasks/user_shell.rs b/codex-rs/core/src/tasks/user_shell.rs index 23cd076404..5dc56b2b4e 100644 --- a/codex-rs/core/src/tasks/user_shell.rs +++ b/codex-rs/core/src/tasks/user_shell.rs @@ -21,6 +21,7 @@ use crate::session::turn_context::TurnContext; use crate::state::TaskKind; use crate::tools::format_exec_output_str; use crate::tools::runtimes::maybe_wrap_shell_lc_with_snapshot; +use crate::turn_timing::now_unix_timestamp_ms; use crate::user_shell_command::user_shell_command_record_item; use codex_protocol::exec_output::ExecToolCallOutput; use codex_protocol::exec_output::StreamOutput; @@ -169,6 +170,7 @@ pub(crate) async fn execute_user_shell_command( parsed_cmd: parsed_cmd.clone(), source: ExecCommandSource::UserShell, interaction_input: None, + started_at_ms: Some(now_unix_timestamp_ms()), }), ) .await; @@ -212,6 +214,7 @@ pub(crate) async fn execute_user_shell_command( match exec_result { Err(CancelErr::Cancelled) => { + let completed_at_ms = now_unix_timestamp_ms(); let aborted_message = "command aborted by user".to_string(); let exec_output = ExecToolCallOutput { exit_code: -1, @@ -241,6 +244,8 @@ pub(crate) async fn execute_user_shell_command( parsed_cmd: parsed_cmd.clone(), source: ExecCommandSource::UserShell, interaction_input: None, + started_at_ms: Some(completed_at_ms), + completed_at_ms: Some(completed_at_ms), stdout: String::new(), stderr: aborted_message.clone(), aggregated_output: aborted_message.clone(), @@ -253,6 +258,8 @@ pub(crate) async fn execute_user_shell_command( .await; } Ok(Ok(output)) => { + let completed_at_ms = now_unix_timestamp_ms(); + let duration_ms = i64::try_from(output.duration.as_millis()).unwrap_or(i64::MAX); session .send_event( turn_context.as_ref(), @@ -265,6 +272,8 @@ pub(crate) async fn execute_user_shell_command( parsed_cmd: parsed_cmd.clone(), source: ExecCommandSource::UserShell, interaction_input: None, + started_at_ms: completed_at_ms.checked_sub(duration_ms), + completed_at_ms: Some(completed_at_ms), stdout: output.stdout.text.clone(), stderr: output.stderr.text.clone(), aggregated_output: output.aggregated_output.text.clone(), @@ -297,6 +306,7 @@ pub(crate) async fn execute_user_shell_command( duration: Duration::ZERO, timed_out: false, }; + let completed_at_ms = now_unix_timestamp_ms(); session .send_event( turn_context.as_ref(), @@ -309,6 +319,8 @@ pub(crate) async fn execute_user_shell_command( parsed_cmd, source: ExecCommandSource::UserShell, interaction_input: None, + started_at_ms: Some(completed_at_ms), + completed_at_ms: Some(completed_at_ms), stdout: exec_output.stdout.text.clone(), stderr: exec_output.stderr.text.clone(), aggregated_output: exec_output.aggregated_output.text.clone(), diff --git a/codex-rs/core/src/tools/events.rs b/codex-rs/core/src/tools/events.rs index 2b215a043d..11e851a69f 100644 --- a/codex-rs/core/src/tools/events.rs +++ b/codex-rs/core/src/tools/events.rs @@ -3,6 +3,7 @@ use crate::session::session::Session; use crate::session::turn_context::TurnContext; use crate::tools::context::SharedTurnDiffTracker; use crate::tools::sandboxing::ToolError; +use crate::turn_timing::now_unix_timestamp_ms; use codex_protocol::error::CodexErr; use codex_protocol::error::SandboxErr; use codex_protocol::exec_output::ExecToolCallOutput; @@ -82,6 +83,7 @@ pub(crate) async fn emit_exec_command_begin( parsed_cmd: parsed_cmd.to_vec(), source, interaction_input, + started_at_ms: Some(now_unix_timestamp_ms()), }), ) .await; @@ -190,6 +192,7 @@ impl ToolEmitter { turn_id: ctx.turn.sub_id.clone(), auto_approved: *auto_approved, changes: changes.clone(), + started_at_ms: Some(now_unix_timestamp_ms()), }), ) .await; @@ -206,6 +209,7 @@ impl ToolEmitter { } else { PatchApplyStatus::Failed }, + output.duration, ) .await; } @@ -224,6 +228,7 @@ impl ToolEmitter { } else { PatchApplyStatus::Failed }, + output.duration, ) .await; } @@ -238,6 +243,7 @@ impl ToolEmitter { (*message).to_string(), /*success*/ false, PatchApplyStatus::Failed, + Duration::ZERO, ) .await; } @@ -252,6 +258,7 @@ impl ToolEmitter { (*message).to_string(), /*success*/ false, PatchApplyStatus::Declined, + Duration::ZERO, ) .await; } @@ -467,6 +474,9 @@ async fn emit_exec_end( exec_input: ExecCommandInput<'_>, exec_result: ExecCommandResult, ) { + let completed_at_ms = now_unix_timestamp_ms(); + let duration_ms = i64::try_from(exec_result.duration.as_millis()).unwrap_or(i64::MAX); + let started_at_ms = completed_at_ms.checked_sub(duration_ms); ctx.session .send_event( ctx.turn, @@ -479,6 +489,8 @@ async fn emit_exec_end( parsed_cmd: exec_input.parsed_cmd.to_vec(), source: exec_input.source, interaction_input: exec_input.interaction_input.map(str::to_owned), + started_at_ms, + completed_at_ms: Some(completed_at_ms), stdout: exec_result.stdout, stderr: exec_result.stderr, aggregated_output: exec_result.aggregated_output, @@ -498,7 +510,12 @@ async fn emit_patch_end( stderr: String, success: bool, status: PatchApplyStatus, + duration: Duration, ) { + let completed_at_ms = now_unix_timestamp_ms(); + let duration_ms = i64::try_from(duration.as_millis()).ok(); + let started_at_ms = + duration_ms.and_then(|duration_ms| completed_at_ms.checked_sub(duration_ms)); ctx.session .send_event( ctx.turn, @@ -510,6 +527,9 @@ async fn emit_patch_end( success, changes, status, + started_at_ms, + completed_at_ms: Some(completed_at_ms), + duration_ms, }), ) .await; diff --git a/codex-rs/core/src/tools/handlers/dynamic.rs b/codex-rs/core/src/tools/handlers/dynamic.rs index b7e07090dc..f6e665a71f 100644 --- a/codex-rs/core/src/tools/handlers/dynamic.rs +++ b/codex-rs/core/src/tools/handlers/dynamic.rs @@ -7,6 +7,7 @@ use crate::tools::context::ToolPayload; use crate::tools::handlers::parse_arguments; use crate::tools::registry::ToolHandler; use crate::tools::registry::ToolKind; +use crate::turn_timing::now_unix_timestamp_ms; use codex_protocol::dynamic_tools::DynamicToolCallRequest; use codex_protocol::dynamic_tools::DynamicToolResponse; use codex_protocol::models::FunctionCallOutputContentItem; @@ -102,16 +103,19 @@ async fn request_dynamic_tool( } let started_at = Instant::now(); + let started_at_ms = now_unix_timestamp_ms(); let event = EventMsg::DynamicToolCallRequest(DynamicToolCallRequest { call_id: call_id.clone(), turn_id: turn_id.clone(), namespace: namespace.clone(), tool: tool.clone(), arguments: arguments.clone(), + started_at_ms: Some(started_at_ms), }); session.send_event(turn_context, event).await; let response = rx_response.await.ok(); + let completed_at_ms = now_unix_timestamp_ms(); let response_event = match &response { Some(response) => EventMsg::DynamicToolCallResponse(DynamicToolCallResponseEvent { call_id, @@ -122,6 +126,8 @@ async fn request_dynamic_tool( content_items: response.content_items.clone(), success: response.success, error: None, + started_at_ms: Some(started_at_ms), + completed_at_ms: Some(completed_at_ms), duration: started_at.elapsed(), }), None => EventMsg::DynamicToolCallResponse(DynamicToolCallResponseEvent { @@ -133,6 +139,8 @@ async fn request_dynamic_tool( content_items: Vec::new(), success: false, error: Some("dynamic tool call was cancelled before receiving a response".to_string()), + started_at_ms: Some(started_at_ms), + completed_at_ms: Some(completed_at_ms), duration: started_at.elapsed(), }), }; diff --git a/codex-rs/core/src/tools/handlers/mcp_resource.rs b/codex-rs/core/src/tools/handlers/mcp_resource.rs index fa4a066741..61039f6029 100644 --- a/codex-rs/core/src/tools/handlers/mcp_resource.rs +++ b/codex-rs/core/src/tools/handlers/mcp_resource.rs @@ -25,6 +25,7 @@ use crate::tools::context::ToolInvocation; use crate::tools::context::ToolPayload; use crate::tools::registry::ToolHandler; use crate::tools::registry::ToolKind; +use crate::turn_timing::now_unix_timestamp_ms; use codex_protocol::protocol::EventMsg; use codex_protocol::protocol::McpInvocation; use codex_protocol::protocol::McpToolCallBeginEvent; @@ -571,6 +572,7 @@ async fn emit_tool_call_begin( call_id: call_id.to_string(), invocation, mcp_app_resource_uri: None, + started_at_ms: None, }), ) .await; @@ -584,6 +586,8 @@ async fn emit_tool_call_end( duration: Duration, result: Result, ) { + let completed_at_ms = now_unix_timestamp_ms(); + let duration_ms = i64::try_from(duration.as_millis()).unwrap_or(i64::MAX); session .send_event( turn, @@ -591,6 +595,8 @@ async fn emit_tool_call_end( call_id: call_id.to_string(), invocation, mcp_app_resource_uri: None, + started_at_ms: completed_at_ms.checked_sub(duration_ms), + completed_at_ms: Some(completed_at_ms), duration, result, }), diff --git a/codex-rs/core/src/tools/handlers/multi_agents/close_agent.rs b/codex-rs/core/src/tools/handlers/multi_agents/close_agent.rs index 8c00b0a13c..f950b1a1db 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents/close_agent.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents/close_agent.rs @@ -29,6 +29,7 @@ impl ToolHandler for Handler { .agent_control .get_agent_metadata(agent_id) .unwrap_or_default(); + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -36,6 +37,7 @@ impl ToolHandler for Handler { call_id: call_id.clone(), sender_thread_id: session.conversation_id, receiver_thread_id: agent_id, + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -49,6 +51,7 @@ impl ToolHandler for Handler { Ok(mut status_rx) => status_rx.borrow_and_update().clone(), Err(err) => { let status = session.services.agent_control.get_status(agent_id).await; + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -59,6 +62,9 @@ impl ToolHandler for Handler { receiver_agent_nickname: receiver_agent.agent_nickname.clone(), receiver_agent_role: receiver_agent.agent_role.clone(), status, + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) @@ -70,6 +76,7 @@ impl ToolHandler for Handler { .await .map_err(|err| collab_agent_error(agent_id, err)) .map(|_| ()); + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -80,6 +87,9 @@ impl ToolHandler for Handler { receiver_agent_nickname: receiver_agent.agent_nickname, receiver_agent_role: receiver_agent.agent_role, status: status.clone(), + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/tools/handlers/multi_agents/resume_agent.rs b/codex-rs/core/src/tools/handlers/multi_agents/resume_agent.rs index 2d4f2c3f47..abd9f2bb6f 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents/resume_agent.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents/resume_agent.rs @@ -41,6 +41,7 @@ impl ToolHandler for Handler { )); } + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -50,6 +51,7 @@ impl ToolHandler for Handler { receiver_thread_id, receiver_agent_nickname: receiver_agent.agent_nickname.clone(), receiver_agent_role: receiver_agent.agent_role.clone(), + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -96,6 +98,7 @@ impl ToolHandler for Handler { } else { (receiver_agent, None) }; + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -106,6 +109,9 @@ impl ToolHandler for Handler { receiver_agent_nickname: receiver_agent.agent_nickname, receiver_agent_role: receiver_agent.agent_role, status: status.clone(), + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/tools/handlers/multi_agents/send_input.rs b/codex-rs/core/src/tools/handlers/multi_agents/send_input.rs index 4ae3240cb3..e8887dd1ee 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents/send_input.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents/send_input.rs @@ -40,6 +40,7 @@ impl ToolHandler for Handler { .await .map_err(|err| collab_agent_error(receiver_thread_id, err))?; } + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -48,6 +49,7 @@ impl ToolHandler for Handler { sender_thread_id: session.conversation_id, receiver_thread_id, prompt: prompt.clone(), + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -62,6 +64,7 @@ impl ToolHandler for Handler { .agent_control .get_status(receiver_thread_id) .await; + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -73,6 +76,9 @@ impl ToolHandler for Handler { receiver_agent_role: receiver_agent.agent_role, prompt, status, + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs b/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs index 777cb9be1c..3796426e6c 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs @@ -46,6 +46,7 @@ impl ToolHandler for Handler { "Agent depth limit reached. Solve the task yourself.".to_string(), )); } + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -55,6 +56,7 @@ impl ToolHandler for Handler { prompt: prompt.clone(), model: args.model.clone().unwrap_or_default(), reasoning_effort: args.reasoning_effort.unwrap_or_default(), + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -149,6 +151,7 @@ impl ToolHandler for Handler { .and_then(|snapshot| snapshot.reasoning_effort) .unwrap_or(args.reasoning_effort.unwrap_or_default()); let nickname = new_agent_nickname.clone(); + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -162,6 +165,9 @@ impl ToolHandler for Handler { model: effective_model, reasoning_effort: effective_reasoning_effort, status, + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/tools/handlers/multi_agents/wait.rs b/codex-rs/core/src/tools/handlers/multi_agents/wait.rs index 77fa5f83a2..83c69f63cf 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents/wait.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents/wait.rs @@ -69,6 +69,7 @@ impl ToolHandler for Handler { ms => ms.clamp(MIN_WAIT_TIMEOUT_MS, MAX_WAIT_TIMEOUT_MS), }; + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -77,6 +78,7 @@ impl ToolHandler for Handler { receiver_thread_ids: receiver_thread_ids.clone(), receiver_agents: receiver_agents.clone(), call_id: call_id.clone(), + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -99,6 +101,7 @@ impl ToolHandler for Handler { Err(err) => { let mut statuses = HashMap::with_capacity(1); statuses.insert(*id, session.services.agent_control.get_status(*id).await); + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -110,6 +113,9 @@ impl ToolHandler for Handler { &receiver_agents, ), statuses, + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) @@ -167,6 +173,7 @@ impl ToolHandler for Handler { timed_out, }; + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -175,6 +182,9 @@ impl ToolHandler for Handler { call_id, agent_statuses, statuses: statuses_by_id, + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/tools/handlers/multi_agents_common.rs b/codex-rs/core/src/tools/handlers/multi_agents_common.rs index c01755cb2b..b7fb220b6a 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_common.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_common.rs @@ -8,6 +8,7 @@ use crate::session::turn_context::TurnContext; use crate::tools::context::FunctionToolOutput; use crate::tools::context::ToolOutput; use crate::tools::context::ToolPayload; +use crate::turn_timing::now_unix_timestamp_ms; use codex_features::Feature; use codex_models_manager::manager::RefreshStrategy; use codex_protocol::AgentPath; @@ -32,6 +33,32 @@ pub(crate) const MIN_WAIT_TIMEOUT_MS: i64 = DEFAULT_MULTI_AGENT_V2_MIN_WAIT_TIME pub(crate) const DEFAULT_WAIT_TIMEOUT_MS: i64 = 30_000; pub(crate) const MAX_WAIT_TIMEOUT_MS: i64 = MAX_MULTI_AGENT_V2_WAIT_TIMEOUT_MS; +#[derive(Clone, Copy)] +pub(crate) struct ToolExecutionTiming { + started_at_ms: i64, +} + +impl ToolExecutionTiming { + pub(crate) fn start() -> Self { + Self { + started_at_ms: now_unix_timestamp_ms(), + } + } + + pub(crate) fn started_at_ms(self) -> Option { + Some(self.started_at_ms) + } + + pub(crate) fn finish(self) -> (Option, Option, Option) { + let completed_at_ms = now_unix_timestamp_ms(); + ( + Some(self.started_at_ms), + Some(completed_at_ms), + completed_at_ms.checked_sub(self.started_at_ms), + ) + } +} + pub(crate) fn function_arguments(payload: ToolPayload) -> Result { match payload { ToolPayload::Function { arguments } => Ok(arguments), diff --git a/codex-rs/core/src/tools/handlers/multi_agents_v2/close_agent.rs b/codex-rs/core/src/tools/handlers/multi_agents_v2/close_agent.rs index 8074f7fe04..ec083ff870 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_v2/close_agent.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_v2/close_agent.rs @@ -38,6 +38,7 @@ impl ToolHandler for Handler { "root is not a spawned agent".to_string(), )); } + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -45,6 +46,7 @@ impl ToolHandler for Handler { call_id: call_id.clone(), sender_thread_id: session.conversation_id, receiver_thread_id: agent_id, + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -58,6 +60,7 @@ impl ToolHandler for Handler { Ok(mut status_rx) => status_rx.borrow_and_update().clone(), Err(err) => { let status = session.services.agent_control.get_status(agent_id).await; + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -68,6 +71,9 @@ impl ToolHandler for Handler { receiver_agent_nickname: receiver_agent.agent_nickname.clone(), receiver_agent_role: receiver_agent.agent_role.clone(), status, + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) @@ -82,6 +88,7 @@ impl ToolHandler for Handler { .await .map_err(|err| collab_agent_error(agent_id, err)) .map(|_| ()); + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -92,6 +99,9 @@ impl ToolHandler for Handler { receiver_agent_nickname: receiver_agent.agent_nickname, receiver_agent_role: receiver_agent.agent_role, status: status.clone(), + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs b/codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs index c9c2fda51e..84098436d9 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs @@ -111,6 +111,7 @@ async fn handle_message_submission( .await .map_err(|err| collab_agent_error(receiver_thread_id, err))?; } + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -119,6 +120,7 @@ async fn handle_message_submission( sender_thread_id: session.conversation_id, receiver_thread_id, prompt: prompt.clone(), + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -146,6 +148,7 @@ async fn handle_message_submission( .agent_control .get_status(receiver_thread_id) .await; + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -157,6 +160,9 @@ async fn handle_message_submission( receiver_agent_role: receiver_agent.agent_role, prompt, status, + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs b/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs index 21b4638c01..c36bff55c9 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs @@ -51,6 +51,7 @@ impl ToolHandler for Handler { "Agent depth limit reached. Solve the task yourself.".to_string(), )); } + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -60,6 +61,7 @@ impl ToolHandler for Handler { prompt: prompt.clone(), model: args.model.clone().unwrap_or_default(), reasoning_effort: args.reasoning_effort.unwrap_or_default(), + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -175,6 +177,7 @@ impl ToolHandler for Handler { .and_then(|snapshot| snapshot.reasoning_effort) .unwrap_or(args.reasoning_effort.unwrap_or_default()); let nickname = new_agent_nickname.clone(); + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -188,6 +191,9 @@ impl ToolHandler for Handler { model: effective_model, reasoning_effort: effective_reasoning_effort, status, + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs b/codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs index 778c57be21..86a56bb397 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs @@ -44,6 +44,7 @@ impl ToolHandler for Handler { let mut mailbox_seq_rx = session.subscribe_mailbox_seq(); + let timing = ToolExecutionTiming::start(); session .send_event( &turn, @@ -52,6 +53,7 @@ impl ToolHandler for Handler { receiver_thread_ids: Vec::new(), receiver_agents: Vec::new(), call_id: call_id.clone(), + started_at_ms: timing.started_at_ms(), } .into(), ) @@ -65,6 +67,7 @@ impl ToolHandler for Handler { }; let result = WaitAgentResult::from_timed_out(timed_out); + let (started_at_ms, completed_at_ms, duration_ms) = timing.finish(); session .send_event( &turn, @@ -73,6 +76,9 @@ impl ToolHandler for Handler { call_id, agent_statuses: Vec::new(), statuses: HashMap::new(), + started_at_ms, + completed_at_ms, + duration_ms, } .into(), ) diff --git a/codex-rs/core/src/turn_timing.rs b/codex-rs/core/src/turn_timing.rs index d6bf37253f..1d0232cde7 100644 --- a/codex-rs/core/src/turn_timing.rs +++ b/codex-rs/core/src/turn_timing.rs @@ -107,7 +107,7 @@ fn now_unix_timestamp_secs() -> i64 { now_unix_timestamp_ms() / 1000 } -fn now_unix_timestamp_ms() -> i64 { +pub(crate) fn now_unix_timestamp_ms() -> i64 { let duration = SystemTime::now() .duration_since(UNIX_EPOCH) .unwrap_or_default(); diff --git a/codex-rs/core/tests/suite/rmcp_client.rs b/codex-rs/core/tests/suite/rmcp_client.rs index 0947f4fba7..f9d33a8f3a 100644 --- a/codex-rs/core/tests/suite/rmcp_client.rs +++ b/codex-rs/core/tests/suite/rmcp_client.rs @@ -1111,6 +1111,7 @@ async fn stdio_image_responses_round_trip() -> anyhow::Result<()> { arguments: Some(json!({})), }, mcp_app_resource_uri: None, + started_at_ms: None, }, ); diff --git a/codex-rs/exec/src/event_processor_with_jsonl_output_tests.rs b/codex-rs/exec/src/event_processor_with_jsonl_output_tests.rs index 2a26ec3c7e..a752c85af5 100644 --- a/codex-rs/exec/src/event_processor_with_jsonl_output_tests.rs +++ b/codex-rs/exec/src/event_processor_with_jsonl_output_tests.rs @@ -20,6 +20,8 @@ fn failed_turn_does_not_overwrite_output_last_message_file() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); diff --git a/codex-rs/exec/tests/event_processor_with_json_output.rs b/codex-rs/exec/tests/event_processor_with_json_output.rs index 23dcd6733a..240618416f 100644 --- a/codex-rs/exec/tests/event_processor_with_json_output.rs +++ b/codex-rs/exec/tests/event_processor_with_json_output.rs @@ -180,6 +180,7 @@ fn command_execution_started_and_completed_translate_to_thread_events() { item: command_item, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, })); assert_eq!( started, @@ -215,6 +216,8 @@ fn command_execution_started_and_completed_translate_to_thread_events() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); assert_eq!( @@ -249,6 +252,8 @@ fn empty_reasoning_items_are_ignored() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -273,6 +278,8 @@ fn unsupported_items_do_not_consume_synthetic_ids() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -294,6 +301,8 @@ fn unsupported_items_do_not_consume_synthetic_ids() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -326,6 +335,8 @@ fn reasoning_items_emit_summary_not_raw_content() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -361,6 +372,8 @@ fn web_search_completion_preserves_query_and_action() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -398,6 +411,7 @@ fn web_search_start_and_completion_reuse_item_id() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, })); let completed = processor.collect_thread_events(ServerNotification::ItemCompleted( @@ -412,6 +426,8 @@ fn web_search_start_and_completion_reuse_item_id() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -471,6 +487,7 @@ fn mcp_tool_call_begin_and_end_emit_item_events() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, })); let completed = processor.collect_thread_events(ServerNotification::ItemCompleted( ItemCompletedNotification { @@ -491,6 +508,8 @@ fn mcp_tool_call_begin_and_end_emit_item_events() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -558,6 +577,8 @@ fn mcp_tool_call_failure_sets_failed_status() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -603,6 +624,7 @@ fn mcp_tool_call_defaults_arguments_and_preserves_structured_content() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, })); let completed = processor.collect_thread_events(ServerNotification::ItemCompleted( ItemCompletedNotification { @@ -626,6 +648,8 @@ fn mcp_tool_call_defaults_arguments_and_preserves_structured_content() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -694,6 +718,7 @@ fn collab_spawn_begin_and_end_emit_item_events() { }, thread_id: "thread-parent".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, })); let completed = processor.collect_thread_events(ServerNotification::ItemCompleted( ItemCompletedNotification { @@ -716,6 +741,8 @@ fn collab_spawn_begin_and_end_emit_item_events() { }, thread_id: "thread-parent".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -794,6 +821,8 @@ fn file_change_completion_maps_change_kinds() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -844,6 +873,8 @@ fn file_change_declined_maps_to_failed_status() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -881,6 +912,8 @@ fn agent_message_item_updates_final_message() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -915,6 +948,7 @@ fn agent_message_item_started_is_ignored() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, })); assert_eq!( @@ -939,6 +973,8 @@ fn reasoning_item_completed_uses_synthetic_id() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -1295,6 +1331,7 @@ fn turn_completion_reconciles_started_items_from_turn_items() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, })); assert_eq!( started, @@ -1377,6 +1414,8 @@ fn turn_completion_overwrites_stale_final_message_from_turn_items() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -1425,6 +1464,8 @@ fn turn_completion_preserves_streamed_final_message_when_turn_items_are_empty() }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); @@ -1469,6 +1510,8 @@ fn failed_turn_clears_stale_final_message() { }, thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, }, )); diff --git a/codex-rs/protocol/src/dynamic_tools.rs b/codex-rs/protocol/src/dynamic_tools.rs index 2bee24972b..e756c14ce0 100644 --- a/codex-rs/protocol/src/dynamic_tools.rs +++ b/codex-rs/protocol/src/dynamic_tools.rs @@ -26,6 +26,9 @@ pub struct DynamicToolCallRequest { pub namespace: Option, pub tool: String, pub arguments: JsonValue, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, JsonSchema, TS)] diff --git a/codex-rs/protocol/src/items.rs b/codex-rs/protocol/src/items.rs index 6879588579..df3ad3ebed 100644 --- a/codex-rs/protocol/src/items.rs +++ b/codex-rs/protocol/src/items.rs @@ -112,6 +112,15 @@ pub struct WebSearchItem { pub id: String, pub query: String, pub action: WebSearchAction, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, TS, JsonSchema, PartialEq)] @@ -125,6 +134,15 @@ pub struct ImageGenerationItem { #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub saved_path: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, TS, JsonSchema)] @@ -365,6 +383,9 @@ impl WebSearchItem { call_id: self.id.clone(), query: self.query.clone(), action: self.action.clone(), + started_at_ms: self.started_at_ms, + completed_at_ms: self.completed_at_ms, + duration_ms: self.duration_ms, }) } } @@ -377,11 +398,40 @@ impl ImageGenerationItem { revised_prompt: self.revised_prompt.clone(), result: self.result.clone(), saved_path: self.saved_path.clone(), + started_at_ms: self.started_at_ms, + completed_at_ms: self.completed_at_ms, + duration_ms: self.duration_ms, }) } } impl TurnItem { + pub fn set_started_at_ms(&mut self, started_at_ms: i64) { + match self { + TurnItem::WebSearch(item) => item.started_at_ms = Some(started_at_ms), + TurnItem::ImageGeneration(item) => item.started_at_ms = Some(started_at_ms), + _ => {} + } + } + + pub fn set_completed_timing_ms(&mut self, started_at_ms: Option, completed_at_ms: i64) { + match self { + TurnItem::WebSearch(item) => { + item.started_at_ms = started_at_ms; + item.completed_at_ms = Some(completed_at_ms); + item.duration_ms = started_at_ms + .and_then(|started_at_ms| completed_at_ms.checked_sub(started_at_ms)); + } + TurnItem::ImageGeneration(item) => { + item.started_at_ms = started_at_ms; + item.completed_at_ms = Some(completed_at_ms); + item.duration_ms = started_at_ms + .and_then(|started_at_ms| completed_at_ms.checked_sub(started_at_ms)); + } + _ => {} + } + } + pub fn id(&self) -> String { match self { TurnItem::UserMessage(item) => item.id.clone(), diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index c9ff684f7c..d188a7eb7b 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -1823,6 +1823,9 @@ pub struct RawResponseItemEvent { pub struct ItemStartedEvent { pub thread_id: ThreadId, pub turn_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, pub item: TurnItem, } @@ -1831,10 +1834,12 @@ impl HasLegacyEvent for ItemStartedEvent { match &self.item { TurnItem::WebSearch(item) => vec![EventMsg::WebSearchBegin(WebSearchBeginEvent { call_id: item.id.clone(), + started_at_ms: item.started_at_ms, })], TurnItem::ImageGeneration(item) => { vec![EventMsg::ImageGenerationBegin(ImageGenerationBeginEvent { call_id: item.id.clone(), + started_at_ms: item.started_at_ms, })] } _ => Vec::new(), @@ -1846,6 +1851,12 @@ impl HasLegacyEvent for ItemStartedEvent { pub struct ItemCompletedEvent { pub thread_id: ThreadId, pub turn_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, pub item: TurnItem, } @@ -2336,6 +2347,9 @@ pub struct McpToolCallBeginEvent { #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub mcp_app_resource_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS, PartialEq)] @@ -2346,6 +2360,12 @@ pub struct McpToolCallEndEvent { #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub mcp_app_resource_uri: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, #[ts(type = "string")] pub duration: Duration, /// Result of the tool call. Note this could be an error. @@ -2371,6 +2391,14 @@ pub struct DynamicToolCallResponseEvent { pub success: bool, /// Optional error text when the tool call failed before producing a response. pub error: Option, + /// Unix timestamp (in milliseconds) when dynamic tool execution started, if known. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + /// Unix timestamp (in milliseconds) when dynamic tool execution completed, if known. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, /// The duration of the dynamic tool call. #[ts(type = "string")] pub duration: Duration, @@ -2388,6 +2416,9 @@ impl McpToolCallEndEvent { #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] pub struct WebSearchBeginEvent { pub call_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] @@ -2395,11 +2426,23 @@ pub struct WebSearchEndEvent { pub call_id: String, pub query: String, pub action: WebSearchAction, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] pub struct ImageGenerationBeginEvent { pub call_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] @@ -2413,6 +2456,15 @@ pub struct ImageGenerationEndEvent { #[serde(skip_serializing_if = "Option::is_none")] #[ts(optional)] pub saved_path: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } // Conversation kept for backward compatibility. @@ -3080,6 +3132,9 @@ pub struct ExecCommandBeginEvent { #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub interaction_input: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] @@ -3104,6 +3159,12 @@ pub struct ExecCommandEndEvent { #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] pub interaction_input: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, /// Captured stdout pub stdout: String, @@ -3225,6 +3286,9 @@ pub struct PatchApplyBeginEvent { pub auto_approved: bool, /// The changes to be applied. pub changes: HashMap, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] @@ -3254,6 +3318,15 @@ pub struct PatchApplyEndEvent { pub changes: HashMap, /// Completion status for this patch application. pub status: PatchApplyStatus, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)] @@ -3776,6 +3849,9 @@ pub struct CollabAgentSpawnBeginEvent { pub prompt: String, pub model: String, pub reasoning_effort: ReasoningEffortConfig, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)] @@ -3827,6 +3903,15 @@ pub struct CollabAgentSpawnEndEvent { pub reasoning_effort: ReasoningEffortConfig, /// Last known status of the new agent reported to the sender agent. pub status: AgentStatus, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] @@ -3840,6 +3925,9 @@ pub struct CollabAgentInteractionBeginEvent { /// Prompt sent from the sender to the receiver. Can be empty to prevent CoT /// leaking at the beginning. pub prompt: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] @@ -3861,6 +3949,15 @@ pub struct CollabAgentInteractionEndEvent { pub prompt: String, /// Last known status of the receiver agent reported to the sender agent. pub status: AgentStatus, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] @@ -3874,6 +3971,9 @@ pub struct CollabWaitingBeginEvent { pub receiver_agents: Vec, /// ID of the waiting call. pub call_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] @@ -3887,6 +3987,15 @@ pub struct CollabWaitingEndEvent { pub agent_statuses: Vec, /// Last known status of the receiver agents reported to the sender agent. pub statuses: HashMap, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] @@ -3897,6 +4006,9 @@ pub struct CollabCloseBeginEvent { pub sender_thread_id: ThreadId, /// Thread ID of the receiver. pub receiver_thread_id: ThreadId, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] @@ -3916,6 +4028,15 @@ pub struct CollabCloseEndEvent { /// Last known status of the receiver agent reported to the sender agent before /// the close. pub status: AgentStatus, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] @@ -3932,6 +4053,9 @@ pub struct CollabResumeBeginEvent { /// Optional role assigned to the receiver agent. #[serde(default, skip_serializing_if = "Option::is_none")] pub receiver_agent_role: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)] @@ -3951,6 +4075,15 @@ pub struct CollabResumeEndEvent { /// Last known status of the receiver agent reported to the sender agent after /// resume. pub status: AgentStatus, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub started_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub completed_at_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub duration_ms: Option, } #[cfg(test)] @@ -4567,6 +4700,7 @@ mod tests { let event = ItemStartedEvent { thread_id: ThreadId::new(), turn_id: "turn-1".into(), + started_at_ms: None, item: TurnItem::WebSearch(WebSearchItem { id: "search-1".into(), query: "find docs".into(), @@ -4574,6 +4708,9 @@ mod tests { query: Some("find docs".into()), queries: None, }, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }), }; @@ -4590,6 +4727,7 @@ mod tests { let event = ItemStartedEvent { thread_id: ThreadId::new(), turn_id: "turn-1".into(), + started_at_ms: None, item: TurnItem::UserMessage(UserMessageItem::new(&[])), }; @@ -4605,12 +4743,16 @@ mod tests { let event = ItemStartedEvent { thread_id: ThreadId::new(), turn_id: "turn-1".into(), + started_at_ms: None, item: TurnItem::ImageGeneration(ImageGenerationItem { id: "ig-1".into(), status: "in_progress".into(), revised_prompt: None, result: String::new(), saved_path: None, + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }), }; @@ -4627,12 +4769,17 @@ mod tests { let event = ItemCompletedEvent { thread_id: ThreadId::new(), turn_id: "turn-1".into(), + started_at_ms: None, + completed_at_ms: None, item: TurnItem::ImageGeneration(ImageGenerationItem { id: "ig-1".into(), status: "completed".into(), revised_prompt: Some("A tiny blue square".into()), result: "Zm9v".into(), saved_path: Some(test_path_buf("/tmp/ig-1.png").abs()), + started_at_ms: None, + completed_at_ms: None, + duration_ms: None, }), }; diff --git a/codex-rs/tui/src/app/app_server_adapter.rs b/codex-rs/tui/src/app/app_server_adapter.rs index 0a1d01aec5..568fd9f937 100644 --- a/codex-rs/tui/src/app/app_server_adapter.rs +++ b/codex-rs/tui/src/app/app_server_adapter.rs @@ -566,6 +566,7 @@ fn server_notification_thread_events( msg: EventMsg::ItemStarted(ItemStartedEvent { thread_id: ThreadId::from_string(¬ification.thread_id).ok()?, turn_id: notification.turn_id.clone(), + started_at_ms: notification.started_at_ms, item: thread_item_to_core(¬ification.item)?, }), }]) @@ -581,6 +582,8 @@ fn server_notification_thread_events( msg: EventMsg::ItemCompleted(ItemCompletedEvent { thread_id: ThreadId::from_string(¬ification.thread_id).ok()?, turn_id: notification.turn_id.clone(), + started_at_ms: notification.started_at_ms, + completed_at_ms: notification.completed_at_ms, item: thread_item_to_core(¬ification.item)?, }), }]) @@ -750,6 +753,8 @@ fn turn_snapshot_events( msg: EventMsg::ItemCompleted(ItemCompletedEvent { thread_id, turn_id: turn.id.clone(), + started_at_ms: None, + completed_at_ms: None, item, }), }); @@ -1121,6 +1126,8 @@ mod tests { }, thread_id: thread_id.clone(), turn_id: turn_id.clone(), + started_at_ms: Some(100), + completed_at_ms: Some(200), }), ) .expect("notification should bridge"); @@ -1141,6 +1148,8 @@ mod tests { ThreadId::from_string(&thread_id).expect("valid thread id") ); assert_eq!(completed.turn_id, turn_id); + assert_eq!(completed.started_at_ms, Some(100)); + assert_eq!(completed.completed_at_ms, Some(200)); match &completed.item { TurnItem::AgentMessage(AgentMessageItem { id, content, phase, .. @@ -1218,6 +1227,7 @@ mod tests { item, thread_id: thread_id.clone(), turn_id: turn_id.clone(), + started_at_ms: Some(100), }), ) .expect("command execution start should bridge"); @@ -1273,6 +1283,8 @@ mod tests { item: completed_item, thread_id, turn_id, + started_at_ms: Some(100), + completed_at_ms: Some(105), }), ) .expect("command execution completion should bridge"); diff --git a/codex-rs/tui/src/app/tests.rs b/codex-rs/tui/src/app/tests.rs index 29f82ab85d..a085c2cc17 100644 --- a/codex-rs/tui/src/app/tests.rs +++ b/codex-rs/tui/src/app/tests.rs @@ -2540,6 +2540,7 @@ async fn inactive_thread_file_change_approval_recovers_buffered_changes() { ServerNotification::ItemStarted(ItemStartedNotification { thread_id: thread_id.to_string(), turn_id: "turn-approval".to_string(), + started_at_ms: None, item: ThreadItem::FileChange { id: "patch-approval".to_string(), changes: vec![FileUpdateChange { @@ -4645,6 +4646,7 @@ async fn replace_chat_widget_reseeds_collab_agent_metadata_for_replay() { codex_app_server_protocol::ItemStartedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, item: ThreadItem::CollabAgentToolCall { id: "wait-1".to_string(), tool: codex_app_server_protocol::CollabAgentTool::Wait, diff --git a/codex-rs/tui/src/chatwidget/tests/app_server.rs b/codex-rs/tui/src/chatwidget/tests/app_server.rs index 9c2e1c83d4..8986b4fcd5 100644 --- a/codex-rs/tui/src/chatwidget/tests/app_server.rs +++ b/codex-rs/tui/src/chatwidget/tests/app_server.rs @@ -67,6 +67,8 @@ async fn live_app_server_user_message_item_completed_does_not_duplicate_rendered ServerNotification::ItemCompleted(ItemCompletedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: AppServerThreadItem::UserMessage { id: "user-1".to_string(), content: vec![AppServerUserInput::Text { @@ -112,6 +114,8 @@ async fn live_app_server_turn_completed_clears_working_status_after_answer_item( ServerNotification::ItemCompleted(ItemCompletedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: AppServerThreadItem::AgentMessage { id: "msg-1".to_string(), text: "Yes. What do you need?".to_string(), @@ -264,6 +268,7 @@ async fn live_app_server_file_change_item_started_preserves_changes() { ServerNotification::ItemStarted(ItemStartedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, item: AppServerThreadItem::FileChange { id: "patch-1".to_string(), changes: vec![FileUpdateChange { @@ -297,6 +302,7 @@ async fn live_app_server_command_execution_strips_shell_wrapper() { ServerNotification::ItemStarted(ItemStartedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, item: AppServerThreadItem::CommandExecution { id: "cmd-1".to_string(), command: command.clone(), @@ -318,6 +324,8 @@ async fn live_app_server_command_execution_strips_shell_wrapper() { ServerNotification::ItemCompleted(ItemCompletedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: AppServerThreadItem::CommandExecution { id: "cmd-1".to_string(), command, @@ -373,6 +381,7 @@ async fn live_app_server_collab_wait_items_render_history() { ServerNotification::ItemStarted(ItemStartedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, item: AppServerThreadItem::CollabAgentToolCall { id: "wait-1".to_string(), tool: AppServerCollabAgentTool::Wait, @@ -395,6 +404,8 @@ async fn live_app_server_collab_wait_items_render_history() { ServerNotification::ItemCompleted(ItemCompletedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: AppServerThreadItem::CollabAgentToolCall { id: "wait-1".to_string(), tool: AppServerCollabAgentTool::Wait, @@ -448,6 +459,7 @@ async fn live_app_server_collab_spawn_completed_renders_requested_model_and_effo ServerNotification::ItemStarted(ItemStartedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, item: AppServerThreadItem::CollabAgentToolCall { id: "spawn-1".to_string(), tool: AppServerCollabAgentTool::SpawnAgent, @@ -467,6 +479,8 @@ async fn live_app_server_collab_spawn_completed_renders_requested_model_and_effo ServerNotification::ItemCompleted(ItemCompletedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: AppServerThreadItem::CollabAgentToolCall { id: "spawn-1".to_string(), tool: AppServerCollabAgentTool::SpawnAgent, diff --git a/codex-rs/tui/src/chatwidget/tests/helpers.rs b/codex-rs/tui/src/chatwidget/tests/helpers.rs index d26a503a89..30451abf11 100644 --- a/codex-rs/tui/src/chatwidget/tests/helpers.rs +++ b/codex-rs/tui/src/chatwidget/tests/helpers.rs @@ -580,6 +580,8 @@ pub(super) fn complete_assistant_message( msg: EventMsg::ItemCompleted(ItemCompletedEvent { thread_id: ThreadId::new(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: TurnItem::AgentMessage(AgentMessageItem { id: item_id.to_string(), content: vec![AgentMessageContent::Text { @@ -624,6 +626,8 @@ pub(super) fn complete_user_message_for_inputs( msg: EventMsg::ItemCompleted(ItemCompletedEvent { thread_id: ThreadId::new(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: TurnItem::UserMessage(UserMessageItem { id: item_id.to_string(), content, diff --git a/codex-rs/tui/src/chatwidget/tests/history_replay.rs b/codex-rs/tui/src/chatwidget/tests/history_replay.rs index 86346885b6..ec7815f76a 100644 --- a/codex-rs/tui/src/chatwidget/tests/history_replay.rs +++ b/codex-rs/tui/src/chatwidget/tests/history_replay.rs @@ -81,6 +81,8 @@ async fn thread_snapshot_replay_does_not_duplicate_agent_message_history() { msg: EventMsg::ItemCompleted(ItemCompletedEvent { thread_id: ThreadId::new(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: TurnItem::AgentMessage(AgentMessageItem { id: "msg-1".to_string(), content: vec![AgentMessageContent::Text { @@ -881,6 +883,8 @@ async fn live_reasoning_summary_is_not_rendered_twice_when_item_completes() { ServerNotification::ItemCompleted(ItemCompletedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: AppServerThreadItem::Reasoning { id: "reasoning-1".to_string(), summary: vec!["Summary only".to_string()], diff --git a/codex-rs/tui/src/chatwidget/tests/review_mode.rs b/codex-rs/tui/src/chatwidget/tests/review_mode.rs index 8061b89fc1..c2de8c83bd 100644 --- a/codex-rs/tui/src/chatwidget/tests/review_mode.rs +++ b/codex-rs/tui/src/chatwidget/tests/review_mode.rs @@ -184,6 +184,7 @@ async fn live_app_server_review_prompt_item_is_not_rendered() { ServerNotification::ItemStarted(ItemStartedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, item: review_mode_item.clone(), }), /*replay_kind*/ None, @@ -196,6 +197,8 @@ async fn live_app_server_review_prompt_item_is_not_rendered() { ServerNotification::ItemCompleted(ItemCompletedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: review_mode_item, }), /*replay_kind*/ None, @@ -206,6 +209,8 @@ async fn live_app_server_review_prompt_item_is_not_rendered() { ServerNotification::ItemCompleted(ItemCompletedNotification { thread_id: "thread-1".to_string(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: AppServerThreadItem::UserMessage { id: "review-prompt".to_string(), content: vec![AppServerUserInput::Text { diff --git a/codex-rs/tui/src/chatwidget/tests/slash_commands.rs b/codex-rs/tui/src/chatwidget/tests/slash_commands.rs index a0ba30e645..46894686ba 100644 --- a/codex-rs/tui/src/chatwidget/tests/slash_commands.rs +++ b/codex-rs/tui/src/chatwidget/tests/slash_commands.rs @@ -1286,6 +1286,8 @@ async fn slash_copy_state_tracks_plan_item_completion() { msg: EventMsg::ItemCompleted(ItemCompletedEvent { thread_id: ThreadId::new(), turn_id: "turn-1".to_string(), + started_at_ms: None, + completed_at_ms: None, item: TurnItem::Plan(PlanItem { id: "plan-1".to_string(), text: plan_text.clone(),