Skip to content

Commit 2f58e69

Browse files
authored
Do not double encode request bodies in logging (#6558)
1 parent ec69a4a commit 2f58e69

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

codex-rs/core/src/chat_completions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ pub(crate) async fn stream_chat_completions(
338338
debug!(
339339
"POST to {}: {}",
340340
provider.get_full_url(&None),
341-
serde_json::to_string_pretty(&payload).unwrap_or_default()
341+
payload.to_string()
342342
);
343343

344344
let mut attempt = 0;

codex-rs/core/src/client.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,9 @@ impl ModelClient {
294294
let auth = auth_manager.as_ref().and_then(|m| m.auth());
295295

296296
trace!(
297-
"POST to {}: {:?}",
297+
"POST to {}: {}",
298298
self.provider.get_full_url(&auth),
299-
serde_json::to_string(payload_json)
300-
.unwrap_or("<unable to serialize payload>".to_string())
299+
payload_json.to_string()
301300
);
302301

303302
let mut req_builder = self

0 commit comments

Comments
 (0)