mirror of
https://github.com/openai/codex.git
synced 2026-11-21 22:50:37 +00:00
[codex-analytics] emit tool item events from item lifecycle
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user