Skip to content

Commit 7407e72

Browse files
ccy-oaicodex
andcommitted
[Codex][Codex CLI] Drop duplicate auth parser test
Co-authored-by: Codex <noreply@openai.com>
1 parent 2931e20 commit 7407e72

1 file changed

Lines changed: 0 additions & 36 deletions

File tree

codex-rs/core/src/client_tests.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@ use super::ModelClient;
33
use super::PendingUnauthorizedRetry;
44
use super::UnauthorizedRecoveryExecution;
55
use super::WebsocketSession;
6-
use crate::response_debug_context::extract_response_debug_context;
7-
use codex_api::TransportError;
86
use codex_otel::SessionTelemetry;
97
use codex_protocol::ThreadId;
108
use codex_protocol::openai_models::ModelInfo;
119
use codex_protocol::protocol::SessionSource;
1210
use codex_protocol::protocol::SubAgentSource;
1311
use pretty_assertions::assert_eq;
14-
use reqwest::StatusCode;
1512
use serde_json::json;
1613

1714
fn 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]
139103
fn auth_request_telemetry_context_tracks_attached_auth_and_retry_phase() {
140104
let auth_context = AuthRequestTelemetryContext::new(

0 commit comments

Comments
 (0)