Skip to content

Commit e40f86b

Browse files
authored
chore: logging cleanup (openai#1196)
Update what we log to make `RUST_LOG=debug` a bit easier to work with. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1196). * openai#1167 * __->__ openai#1196
1 parent 7896b10 commit e40f86b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

codex-rs/core/src/client.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ impl ModelClient {
117117
let base_url = self.provider.base_url.clone();
118118
let base_url = base_url.trim_end_matches('/');
119119
let url = format!("{}/responses", base_url);
120-
debug!(url, "POST");
121-
trace!("request payload: {}", serde_json::to_string(&payload)?);
120+
trace!("POST to {url}: {}", serde_json::to_string(&payload)?);
122121

123122
let mut attempt = 0;
124123
loop {
@@ -303,6 +302,19 @@ where
303302
};
304303
};
305304
}
305+
"response.content_part.done"
306+
| "response.created"
307+
| "response.function_call_arguments.delta"
308+
| "response.in_progress"
309+
| "response.output_item.added"
310+
| "response.output_text.delta"
311+
| "response.output_text.done"
312+
| "response.reasoning_summary_part.added"
313+
| "response.reasoning_summary_text.delta"
314+
| "response.reasoning_summary_text.done" => {
315+
// Currently, we ignore these events, but we handle them
316+
// separately to skip the logging message in the `other` case.
317+
}
306318
other => debug!(other, "sse event"),
307319
}
308320
}

codex-rs/core/src/openai_tools.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ pub(crate) fn create_tools_json_for_responses_api(
9393
.map(|(name, tool)| mcp_tool_to_openai_tool(name, tool)),
9494
);
9595

96-
tracing::debug!("tools_json: {}", serde_json::to_string_pretty(&tools_json)?);
9796
Ok(tools_json)
9897
}
9998

0 commit comments

Comments
 (0)