Skip to content

Commit 9e52f33

Browse files
aibrahim-oaicodex
andcommitted
codex: fix CI failure on PR #15150
Move the telemetry auth-mode conversion back into codex-core callsites to avoid an orphan impl in codex-login, and include the stale Cargo.lock cleanup from the core dependency removal. Co-authored-by: Codex <noreply@openai.com>
1 parent 5848ca1 commit 9e52f33

4 files changed

Lines changed: 11 additions & 16 deletions

File tree

codex-rs/Cargo.lock

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/core/src/codex.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::sync::Arc;
77
use std::sync::atomic::AtomicU64;
88

99
use crate::AuthManager;
10+
use crate::AuthMode;
1011
use crate::CodexAuth;
1112
use crate::SandboxState;
1213
use crate::agent::AgentControl;
@@ -1577,7 +1578,10 @@ impl Session {
15771578
}
15781579

15791580
let auth = auth.as_ref();
1580-
let auth_mode = auth.map(CodexAuth::auth_mode).map(TelemetryAuthMode::from);
1581+
let auth_mode = auth.map(CodexAuth::auth_mode).map(|mode| match mode {
1582+
AuthMode::ApiKey => TelemetryAuthMode::ApiKey,
1583+
AuthMode::Chatgpt | AuthMode::ChatgptAuthTokens => TelemetryAuthMode::Chatgpt,
1584+
});
15811585
let account_id = auth.and_then(CodexAuth::get_account_id);
15821586
let account_email = auth.and_then(CodexAuth::get_account_email);
15831587
let originator = crate::default_client::originator().value;

codex-rs/core/src/models_manager/manager.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,12 @@ impl ModelsManager {
441441
);
442442
let transport = ReqwestTransport::new(build_reqwest_client());
443443
let request_telemetry: Arc<dyn RequestTelemetry> = Arc::new(ModelsRequestTelemetry {
444-
auth_mode: auth_mode.map(|mode| TelemetryAuthMode::from(mode).to_string()),
444+
auth_mode: auth_mode
445+
.map(|mode| match mode {
446+
AuthMode::ApiKey => TelemetryAuthMode::ApiKey,
447+
AuthMode::Chatgpt | AuthMode::ChatgptAuthTokens => TelemetryAuthMode::Chatgpt,
448+
})
449+
.map(|mode| mode.to_string()),
445450
auth_header_attached: api_auth.auth_header_attached(),
446451
auth_header_name: api_auth.auth_header_name(),
447452
auth_env,

codex-rs/login/src/auth/manager.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,6 @@ impl From<AuthMode> for TelemetryAuthMode {
5454
}
5555
}
5656

57-
impl From<crate::AuthMode> for TelemetryAuthMode {
58-
fn from(mode: crate::AuthMode) -> Self {
59-
match mode {
60-
crate::AuthMode::ApiKey => TelemetryAuthMode::ApiKey,
61-
crate::AuthMode::Chatgpt | crate::AuthMode::ChatgptAuthTokens => {
62-
TelemetryAuthMode::Chatgpt
63-
}
64-
}
65-
}
66-
}
67-
6857
/// Authentication mechanism used by the current user.
6958
#[derive(Debug, Clone)]
7059
pub enum CodexAuth {

0 commit comments

Comments
 (0)