@@ -3,15 +3,12 @@ use super::ModelClient;
33use super :: PendingUnauthorizedRetry ;
44use super :: UnauthorizedRecoveryExecution ;
55use super :: WebsocketSession ;
6- use crate :: response_debug_context:: extract_response_debug_context;
7- use codex_api:: TransportError ;
86use codex_otel:: SessionTelemetry ;
97use codex_protocol:: ThreadId ;
108use codex_protocol:: openai_models:: ModelInfo ;
119use codex_protocol:: protocol:: SessionSource ;
1210use codex_protocol:: protocol:: SubAgentSource ;
1311use pretty_assertions:: assert_eq;
14- use reqwest:: StatusCode ;
1512use serde_json:: json;
1613
1714fn test_model_client ( session_source : SessionSource ) -> ModelClient {
@@ -102,39 +99,6 @@ async fn summarize_memories_returns_empty_for_empty_input() {
10299 assert_eq ! ( output. len( ) , 0 ) ;
103100}
104101
105- #[ test]
106- fn extract_response_debug_context_decodes_identity_headers ( ) {
107- let mut headers = http:: HeaderMap :: new ( ) ;
108- headers. insert (
109- "x-oai-request-id" ,
110- http:: HeaderValue :: from_static ( "req-401" ) ,
111- ) ;
112- headers. insert ( "cf-ray" , http:: HeaderValue :: from_static ( "ray-401" ) ) ;
113- headers. insert (
114- "x-openai-authorization-error" ,
115- http:: HeaderValue :: from_static ( "missing_authorization_header" ) ,
116- ) ;
117- headers. insert (
118- "x-error-json" ,
119- http:: HeaderValue :: from_static ( "eyJlcnJvciI6eyJjb2RlIjoidG9rZW5fZXhwaXJlZCJ9fQ==" ) ,
120- ) ;
121-
122- let context = extract_response_debug_context ( & TransportError :: Http {
123- status : StatusCode :: UNAUTHORIZED ,
124- url : Some ( "https://chatgpt.com/backend-api/codex/models" . to_string ( ) ) ,
125- headers : Some ( headers) ,
126- body : Some ( r#"{"detail":"Unauthorized"}"# . to_string ( ) ) ,
127- } ) ;
128-
129- assert_eq ! ( context. request_id. as_deref( ) , Some ( "req-401" ) ) ;
130- assert_eq ! ( context. cf_ray. as_deref( ) , Some ( "ray-401" ) ) ;
131- assert_eq ! (
132- context. auth_error. as_deref( ) ,
133- Some ( "missing_authorization_header" )
134- ) ;
135- assert_eq ! ( context. auth_error_code. as_deref( ) , Some ( "token_expired" ) ) ;
136- }
137-
138102#[ test]
139103fn auth_request_telemetry_context_tracks_attached_auth_and_retry_phase ( ) {
140104 let auth_context = AuthRequestTelemetryContext :: new (
0 commit comments