fix(tracing): preserve response IDs in redacted traces - #4641
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37deba46f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
37deba4 to
b43c27f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b43c27fb5c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b43c27f to
b37a71a
Compare
This pull request fixes response spans created by the built-in OpenAI Responses model when sensitive trace payloads are disabled. Previously, these spans omitted the Response object as intended, but
ResponseSpanData.export()could then no longer derive the Responses APIresponse_id, leaving the exported span without its correlation identifier.Successful non-streaming and streaming spans now retain only the
response_idalongside usage when the active effective endpoint is the official OpenAI endpoint. Provider-controlled IDs from custom HTTP and WebSocket endpoints remain excluded in redacted mode. The WebSocket path applies the existing HTTPS-to-WSS normalization for this trace decision without changing prompt-cache eligibility. The Response object, model input, response content, tool arguments and results, and other sensitive payloads remain excluded from the span. The streaming path records the identifier before yieldingresponse.completed, so it remains available when a consumer closes the stream at the terminal event. Tracing-disabled, failure, cancellation, usage-accounting, raw-response-ID, prompt-cache, and sensitive-data-enabled behavior remain unchanged.The identifier does not change the Responses API storage policy. When an official OpenAI Response is stored, the Platform Traces UI can use the identifier to resolve and display data from the separately stored Responses log even though that data is absent from the trace span payload. With
store=False, the raw response span still contains theresponse_id, while the current Platform detail view cannot retrieve the Response and does not display its input or output.