mirror of
https://github.com/openai/codex.git
synced 2026-11-23 15:18:14 +00:00
Avoid cloning ignored analytics notifications (#36020)
## What changed - Pass server notifications to analytics tracking by reference. - Clone only the notification variants that are recorded as analytics facts. ## Testing - Add unit coverage that verifies a turn diff notification is enqueued and a command output delta notification is ignored. GitOrigin-RevId: 2fa0711dbdcca33dce82c3ef78ee53a3f5a65bd9
This commit is contained in:
1 parent
a5082373f1
commit
88d6c2b2b4
3 files changed
+43
-3
No files matched your search
@@ -582,7 +582,8 @@ impl AnalyticsEventsClient {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn track_notification(&self, notification: ServerNotification) {
|
||||
/// Records analytics-relevant notifications without cloning ignored variants.
|
||||
pub fn track_notification(&self, notification: &ServerNotification) {
|
||||
if !matches!(
|
||||
notification,
|
||||
ServerNotification::TurnStarted(_)
|
||||
@@ -595,7 +596,7 @@ impl AnalyticsEventsClient {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
self.record_fact(AnalyticsFact::Notification(Box::new(notification)));
|
||||
self.record_fact(AnalyticsFact::Notification(Box::new(notification.clone())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user