diff --git a/backend/crates/providers/openai/src/admin.rs b/backend/crates/providers/openai/src/admin.rs index 97a112657..9a7c58c81 100644 --- a/backend/crates/providers/openai/src/admin.rs +++ b/backend/crates/providers/openai/src/admin.rs @@ -202,7 +202,7 @@ impl ProviderAdmin for OpenAiAdminProvider { version: profile.codex_version, build: None, target: DashboardWireTarget { - os_type: dashboard_os_type(&profile.os_type), + os_type: profile.os_type, os_version: profile.os_version, arch: profile.arch, terminal: profile.terminal, @@ -695,13 +695,6 @@ fn account_from_record(account: &AccountRecord) -> Result String { - match os_type { - "Mac OS" => "macOS".to_owned(), - _ => os_type.to_owned(), - } -} - fn dashboard_desktop_release( profile: &CodexWireProfile, snapshot: CodexDesktopReleaseSnapshot, diff --git a/backend/crates/providers/openai/src/config.rs b/backend/crates/providers/openai/src/config.rs index 6e32e8b57..9dc45fe6f 100644 --- a/backend/crates/providers/openai/src/config.rs +++ b/backend/crates/providers/openai/src/config.rs @@ -356,7 +356,7 @@ impl From for CodexWireProfile { codex_version: value.codex_version, desktop_version: value.desktop_version, desktop_build: value.desktop_build, - os_type: canonical_codex_os_type(value.os_type), + os_type: value.os_type, os_version: value.os_version, arch: value.arch, terminal: value.terminal, @@ -365,13 +365,6 @@ impl From for CodexWireProfile { } } -fn canonical_codex_os_type(os_type: String) -> String { - match os_type.as_str() { - "macOS" => "Mac OS".to_owned(), - _ => os_type, - } -} - #[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)] pub enum OpenAiConfigError { #[error("OpenAI configuration field is invalid: {0}")] diff --git a/backend/crates/providers/openai/tests/admin.rs b/backend/crates/providers/openai/tests/admin.rs index 1660f0a9b..c04de269b 100644 --- a/backend/crates/providers/openai/tests/admin.rs +++ b/backend/crates/providers/openai/tests/admin.rs @@ -119,7 +119,7 @@ async fn openai_admin_provider_exposes_live_wire_profile_and_validated_billing() let profile = admin.dashboard_wire_profile().expect("wire profile"); assert_eq!(profile.version, "0.102.0"); assert_eq!(profile.build, None); - assert_eq!(profile.target.os_type, "macOS"); + assert_eq!(profile.target.os_type, "Mac OS"); assert_eq!(profile.target.os_version, "15.5.0"); assert_eq!( profile.user_agent, @@ -795,7 +795,7 @@ fn valid_config() -> TestOpenAiConfig { codex_version: "0.102.0".to_owned(), desktop_version: "1.2026.190".to_owned(), desktop_build: "19012345678".to_owned(), - os_type: "macOS".to_owned(), + os_type: "Mac OS".to_owned(), os_version: "15.5.0".to_owned(), arch: "arm64".to_owned(), terminal: "xterm-256color".to_owned(), diff --git a/backend/crates/providers/openai/tests/config.rs b/backend/crates/providers/openai/tests/config.rs index 1a24a761e..ff7acf608 100644 --- a/backend/crates/providers/openai/tests/config.rs +++ b/backend/crates/providers/openai/tests/config.rs @@ -137,7 +137,7 @@ fn valid_config() -> OpenAiConfig { codex_version: "0.102.0".to_owned(), desktop_version: "1.2026.190".to_owned(), desktop_build: "19012345678".to_owned(), - os_type: "macOS".to_owned(), + os_type: "Mac OS".to_owned(), os_version: "15.5.0".to_owned(), arch: "arm64".to_owned(), terminal: "xterm-256color".to_owned(),