chore: logging cleanup (#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). * #1167 * __->__ #1196
This commit is contained in:
@@ -117,8 +117,7 @@ impl ModelClient {
|
|||||||
let base_url = self.provider.base_url.clone();
|
let base_url = self.provider.base_url.clone();
|
||||||
let base_url = base_url.trim_end_matches('/');
|
let base_url = base_url.trim_end_matches('/');
|
||||||
let url = format!("{}/responses", base_url);
|
let url = format!("{}/responses", base_url);
|
||||||
debug!(url, "POST");
|
trace!("POST to {url}: {}", serde_json::to_string(&payload)?);
|
||||||
trace!("request payload: {}", serde_json::to_string(&payload)?);
|
|
||||||
|
|
||||||
let mut attempt = 0;
|
let mut attempt = 0;
|
||||||
loop {
|
loop {
|
||||||
@@ -303,6 +302,19 @@ where
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
"response.content_part.done"
|
||||||
|
| "response.created"
|
||||||
|
| "response.function_call_arguments.delta"
|
||||||
|
| "response.in_progress"
|
||||||
|
| "response.output_item.added"
|
||||||
|
| "response.output_text.delta"
|
||||||
|
| "response.output_text.done"
|
||||||
|
| "response.reasoning_summary_part.added"
|
||||||
|
| "response.reasoning_summary_text.delta"
|
||||||
|
| "response.reasoning_summary_text.done" => {
|
||||||
|
// Currently, we ignore these events, but we handle them
|
||||||
|
// separately to skip the logging message in the `other` case.
|
||||||
|
}
|
||||||
other => debug!(other, "sse event"),
|
other => debug!(other, "sse event"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ pub(crate) fn create_tools_json_for_responses_api(
|
|||||||
.map(|(name, tool)| mcp_tool_to_openai_tool(name, tool)),
|
.map(|(name, tool)| mcp_tool_to_openai_tool(name, tool)),
|
||||||
);
|
);
|
||||||
|
|
||||||
tracing::debug!("tools_json: {}", serde_json::to_string_pretty(&tools_json)?);
|
|
||||||
Ok(tools_json)
|
Ok(tools_json)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user