From e2e534280ae15c8535bdd4bd41f40fc36067fafe Mon Sep 17 00:00:00 2001 From: Roy Han Date: Tue, 31 Mar 2026 15:15:15 -0700 Subject: [PATCH] fmt --- .../analytics/src/analytics_client_tests.rs | 2 +- codex-rs/analytics/src/reducer.rs | 56 ++++++++++--------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/codex-rs/analytics/src/analytics_client_tests.rs b/codex-rs/analytics/src/analytics_client_tests.rs index 6ba3ec7abf..1e22b0ad06 100644 --- a/codex-rs/analytics/src/analytics_client_tests.rs +++ b/codex-rs/analytics/src/analytics_client_tests.rs @@ -40,8 +40,8 @@ use codex_app_server_protocol::InitializeCapabilities; use codex_app_server_protocol::InitializeParams; use codex_app_server_protocol::RequestId; use codex_app_server_protocol::SandboxPolicy as AppServerSandboxPolicy; -use codex_app_server_protocol::SessionSource as AppServerSessionSource; use codex_app_server_protocol::ServerNotification; +use codex_app_server_protocol::SessionSource as AppServerSessionSource; use codex_app_server_protocol::Thread; use codex_app_server_protocol::ThreadResumeResponse; use codex_app_server_protocol::ThreadStartResponse; diff --git a/codex-rs/analytics/src/reducer.rs b/codex-rs/analytics/src/reducer.rs index a01abd286c..b76a10cd1d 100644 --- a/codex-rs/analytics/src/reducer.rs +++ b/codex-rs/analytics/src/reducer.rs @@ -430,21 +430,23 @@ impl AnalyticsReducer { let Some(connection_state) = self.connections.get(&connection_id) else { return; }; - out.push(TrackEventRequest::ThreadInitialized(ThreadInitializedEvent { - event_type: "codex_thread_initialized", - event_params: ThreadInitializedEventParams { - thread_id: thread.id, - app_server_client: connection_state.app_server_client.clone(), - runtime: connection_state.runtime.clone(), - model, - ephemeral: thread.ephemeral, - thread_source: thread_source_name(&thread_source), - initialization_mode, - subagent_source: None, - parent_thread_id: None, - created_at: u64::try_from(thread.created_at).unwrap_or_default(), + out.push(TrackEventRequest::ThreadInitialized( + ThreadInitializedEvent { + event_type: "codex_thread_initialized", + event_params: ThreadInitializedEventParams { + thread_id: thread.id, + app_server_client: connection_state.app_server_client.clone(), + runtime: connection_state.runtime.clone(), + model, + ephemeral: thread.ephemeral, + thread_source: thread_source_name(&thread_source), + initialization_mode, + subagent_source: None, + parent_thread_id: None, + created_at: u64::try_from(thread.created_at).unwrap_or_default(), + }, }, - })); + )); } fn maybe_emit_turn_event(&mut self, turn_id: &str, out: &mut Vec) { @@ -468,18 +470,20 @@ impl AnalyticsReducer { .and_then(|connection_id| self.connections.get(&connection_id)) .map(|connection_state| connection_state.app_server_client.product_client_id.clone()) .unwrap_or_else(|| originator().value); - out.push(TrackEventRequest::TurnEvent(Box::new(CodexTurnEventRequest { - event_type: "codex_turn_event", - event_params: codex_turn_event_params( - product_client_id, - thread_id, - turn_id.to_string(), - num_input_images, - resolved_config, - completed, - turn_state.created_at, - ), - }))); + out.push(TrackEventRequest::TurnEvent(Box::new( + CodexTurnEventRequest { + event_type: "codex_turn_event", + event_params: codex_turn_event_params( + product_client_id, + thread_id, + turn_id.to_string(), + num_input_images, + resolved_config, + completed, + turn_state.created_at, + ), + }, + ))); self.turns.remove(turn_id); } }