fix(openai): keep Codex wire OS exact

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Zyy
2026-08-05 00:03:21 +08:00
co-authored by Codex
parent f6e5d8f673
commit ebbed22f36
4 changed files with 5 additions and 19 deletions
+1 -8
View File
@@ -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<ProviderAccount, Provi
))
}
fn dashboard_os_type(os_type: &str) -> String {
match os_type {
"Mac OS" => "macOS".to_owned(),
_ => os_type.to_owned(),
}
}
fn dashboard_desktop_release(
profile: &CodexWireProfile,
snapshot: CodexDesktopReleaseSnapshot,
@@ -356,7 +356,7 @@ impl From<CodexWireProfileConfig> 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<CodexWireProfileConfig> 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}")]
@@ -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(),
@@ -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(),