codex: fix CI failure on PR #31730

This commit is contained in:
Adam Perry
2026-07-10 00:15:03 +00:00
parent 5158740113
commit a9f4788631
@@ -1,7 +1,9 @@
use codex_exec_server_protocol::JSONRPCNotification;
use tracing::warn;
use crate::rpc::should_trace_server_notification;
use crate::protocol::EXEC_CLOSED_METHOD;
use crate::protocol::EXEC_EXITED_METHOD;
use crate::protocol::HTTP_REQUEST_BODY_DELTA_METHOD;
pub(super) fn notification_span(notification: &JSONRPCNotification) -> tracing::Span {
let method = notification.method.as_str();
@@ -9,7 +11,18 @@ pub(super) fn notification_span(notification: &JSONRPCNotification) -> tracing::
.params
.as_ref()
.unwrap_or(&serde_json::Value::Null);
if !should_trace_server_notification(method, params) {
let should_trace = match method {
EXEC_EXITED_METHOD | EXEC_CLOSED_METHOD => true,
HTTP_REQUEST_BODY_DELTA_METHOD => {
let Some(params) = params.as_object() else {
return tracing::Span::none();
};
params.get("done").and_then(serde_json::Value::as_bool) == Some(true)
|| params.get("error").is_some_and(|error| !error.is_null())
}
_ => false,
};
if !should_trace {
return tracing::Span::none();
}
let span = tracing::info_span!(