From 8b79d8a5f537068a9128687af2dd5c1a5fac01ac Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sun, 20 Sep 2026 19:59:19 +0000 Subject: [PATCH] Count TUI launches by fullscreen transcript configuration (#46879) ## What changed Increment `codex.tui.fullscreen_transcript` after final startup configuration resolution, tagging `enabled` with the configured `tui_fullscreen_transcript` value regardless of screen policy. Emit the metric only when analytics are not explicitly disabled, a metrics exporter is configured, and a global metrics client is available. GitOrigin-RevId: 59732bc33dfa25f2fb1947ceec2e300e8e0045ca --- codex-rs/tui/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/codex-rs/tui/src/lib.rs b/codex-rs/tui/src/lib.rs index 3161e6e2c4..1c9714ae49 100644 --- a/codex-rs/tui/src/lib.rs +++ b/codex-rs/tui/src/lib.rs @@ -1841,6 +1841,18 @@ async fn run_ratatui_app( } startup_draft.apply_config(&config); + // Count launches that reach final config resolution, regardless of screen policy. + if config.analytics_enabled != Some(false) + && config.otel.metrics_exporter != codex_config::types::OtelExporterKind::None + && let Some(metrics) = codex_otel::global() + { + let _ = metrics.counter( + "codex.tui.fullscreen_transcript", + /*inc*/ 1, + &[("enabled", &config.tui_fullscreen_transcript.to_string())], + ); + } + // Cloud configuration and session selection can change screen policy after first paint. let use_alt_screen = determine_alt_screen_mode(cli.no_alt_screen, config.tui_alternate_screen); let mode = crate::transcript_mode::TranscriptMode::resolve(