Lightweight coding agent that runs in your terminal
Rust
Log headers in trace mode (#9214)
pakrym-oaie958d0337e98
diff --git a/codex-rs/codex-client/src/default_client.rs b/codex-rs/codex-client/src/default_client.rsindex 781ded3614..4e328f7ae7 100644--- a/codex-rs/codex-client/src/default_client.rs+++ b/codex-rs/codex-client/src/default_client.rs@@ -8,7 +8,6 @@ use reqwest::header::HeaderMap;use reqwest::header::HeaderName;use reqwest::header::HeaderValue;use serde::Serialize;-use std::collections::HashMap;use std::fmt::Display;use std::time::Duration;use tracing::Span;@@ -116,12 +115,11 @@ impl CodexRequestBuilder {match self.builder.headers(headers).send().await {Ok(response) => {- let request_ids = Self::extract_request_ids(&response);tracing::debug!(method = %self.method,url = %self.url,status = %response.status(),- request_ids = ?request_ids,+ headers = ?response.headers(),version = ?response.version(),"Request completed");@@ -141,18 +139,6 @@ impl CodexRequestBuilder {}}}-- fn extract_request_ids(response: &Response) -> HashMap<String, String> {- ["cf-ray", "x-request-id", "x-oai-request-id"]- .iter()- .filter_map(|&name| {- let header_name = HeaderName::from_static(name);- let value = response.headers().get(header_name)?;- let value = value.to_str().ok()?.to_owned();- Some((name.to_owned(), value))- })- .collect()- }}struct HeaderMapInjector<'a>(&'a mut HeaderMap);