Skip to content

fix(tracing): preserve response IDs in redacted traces - #4641

Merged
seratch merged 1 commit into
mainfrom
fix/preserve-redacted-response-id
Aug 25, 2026
Merged

fix(tracing): preserve response IDs in redacted traces#4641
seratch merged 1 commit into
mainfrom
fix/preserve-redacted-response-id

Conversation

@seratch

@seratch seratch commented Aug 25, 2026

Copy link
Copy Markdown
Member

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 API response_id, leaving the exported span without its correlation identifier.

Successful non-streaming and streaming spans now retain only the response_id alongside 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 yielding response.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 the response_id, while the current Platform detail view cannot retrieve the Response and does not display its input or output.

@seratch seratch added this to the 0.22.x milestone Aug 25, 2026
@seratch seratch changed the title fix: preserve response IDs in redacted traces fix(tracing): preserve response IDs in redacted traces Aug 25, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-25T01:18:10.839819Z b37a71a New commits
🔒 Security Review Completed 2026-08-25T01:18:53.954053Z b37a71a New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/agents/models/openai_responses.py Outdated
@seratch
seratch force-pushed the fix/preserve-redacted-response-id branch from 37deba4 to b43c27f Compare August 25, 2026 00:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tests/test_responses_tracing.py
@seratch
seratch force-pushed the fix/preserve-redacted-response-id branch from b43c27f to b37a71a Compare August 25, 2026 01:15
@seratch
seratch merged commit f265bae into main Aug 25, 2026
17 checks passed
@seratch
seratch deleted the fix/preserve-redacted-response-id branch August 25, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant