analytics: reduce responses api call facts

This commit is contained in:
rhan-oai
2026-04-15 17:23:07 -07:00
parent d650215ec7
commit f2ad6dd2ca
4 changed files with 296 additions and 0 deletions
+7
View File
@@ -18,6 +18,7 @@ use crate::facts::TrackEventsContext;
use crate::facts::TurnResolvedConfigFact;
use crate::facts::TurnTokenUsageFact;
use crate::reducer::AnalyticsReducer;
use crate::responses_api::CodexResponsesApiCallFact;
use codex_app_server_protocol::ClientRequest;
use codex_app_server_protocol::ClientResponse;
use codex_app_server_protocol::InitializeParams;
@@ -206,6 +207,12 @@ impl AnalyticsEventsClient {
)));
}
pub fn track_responses_api_call(&self, event: CodexResponsesApiCallFact) {
self.record_fact(AnalyticsFact::Custom(
CustomAnalyticsFact::ResponsesApiCall(Box::new(event)),
));
}
pub fn track_turn_resolved_config(&self, fact: TurnResolvedConfigFact) {
self.record_fact(AnalyticsFact::Custom(
CustomAnalyticsFact::TurnResolvedConfig(Box::new(fact)),