File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use std::sync::Arc;
77use std:: sync:: atomic:: AtomicU64 ;
88
99use crate :: AuthManager ;
10+ use crate :: AuthMode ;
1011use crate :: CodexAuth ;
1112use crate :: SandboxState ;
1213use 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 ;
Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff 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 ) ]
7059pub enum CodexAuth {
You can’t perform that action at this time.
0 commit comments