[codex-analytics] emit tool item events from item lifecycle

This commit is contained in:
rhan-oai
2026-04-20 13:07:01 -07:00
parent 888f26ae4b
commit ff079effc8
5 changed files with 890 additions and 28 deletions
+8 -2
View File
@@ -532,7 +532,7 @@ impl OutgoingMessageSender {
targeted_connections = connection_ids.len(),
"app-server event: {notification}"
);
let outgoing_message = OutgoingMessage::AppServerNotification(notification);
let outgoing_message = OutgoingMessage::AppServerNotification(notification.clone());
if connection_ids.is_empty() {
if let Err(err) = self
.sender
@@ -556,6 +556,9 @@ impl OutgoingMessageSender {
.await
{
warn!("failed to send server notification to client: {err:?}");
} else {
self.analytics_events_client
.track_connection_notification(connection_id.0, notification.clone());
}
}
}
@@ -566,7 +569,7 @@ impl OutgoingMessageSender {
notification: ServerNotification,
) {
tracing::trace!("app-server event: {notification}");
let outgoing_message = OutgoingMessage::AppServerNotification(notification);
let outgoing_message = OutgoingMessage::AppServerNotification(notification.clone());
let (write_complete_tx, write_complete_rx) = oneshot::channel();
if let Err(err) = self
.sender
@@ -578,6 +581,9 @@ impl OutgoingMessageSender {
.await
{
warn!("failed to send server notification to client: {err:?}");
} else {
self.analytics_events_client
.track_connection_notification(connection_id.0, notification);
}
let _ = write_complete_rx.await;
}