Repository navigation
feat(tracing): add per-run capture and an OpenTelemetry processor - #6105
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (2)
ℹ️ 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 Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 7de7610f5f
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7de7610f5f
ℹ️ 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".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Request changes. Static review and independent review confirmed the existing findings: bound JSON parsing before applying the capture budget and normalize Chat Completions output for the OpenTelemetry message projection. Please address both; I have not duplicated their inline comments.
I also found the Python 3.10 timestamp compatibility problem described in the inline comment. Reviewed capture permissions, redaction, retry grouping, approval/execution boundaries, processor context and cleanup, optional dependencies, and regression coverage. No other actionable findings.
Hosted checks: {"SKIPPED": 4, "SUCCESS": 16, "FAILURE": 3}. Python 3.10 fails the new timestamp regression (introduced in #6105); both Windows jobs still have the known UnixLocalSandbox collection failures. No candidate code or local tests were executed; the patched Codex binary was not built or run during this review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83962e9357
ℹ️ 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".
There was a problem hiding this comment.
Re-reviewed the updated commit with an independent second reviewer. The Python 3.10 nanosecond timestamp issue is fixed. The earlier findings remain: bound JSON parsing before applying the capture budget and normalize Chat Completions output for the OpenTelemetry message projection. Please address both; no duplicate inline comments added. The portability changes introduce no additional finding.
Hosted check snapshot: {"SKIPPED": 6, "SUCCESS": 17, "FAILURE": 2}. Both Windows test jobs fail on existing selector-loop subprocess and Windows file-URI issues; the other 17 checks passed. Static review only; no candidate code or local tests were executed.
I also independently confirmed the additional existing capture-boundary finding: GenerationSpanData stores and exports raw input/output, and the Chat Completions adapter directly assigns converted messages and response dumps. Native processors and hosted exports therefore bypass the new bounded/redacted content policy. Apply that policy before exposing operation content to processors, while preserving legacy behavior outside the opt-in mode. This is a third outstanding finding; no duplicate inline comment added.
There was a problem hiding this comment.
Approved after static re-review and an independent second review. All three outstanding findings are addressed: oversized structured strings are budget-checked before JSON parsing; generation payloads are bounded/redacted or suppressed on construction and assignment before native processors and hosted export; streamed and non-streamed Chat Completions outputs now project text and tool calls correctly. The earlier Python 3.10 timestamp fix remains intact. Reviewed the capture-policy regression coverage and the accompanying Windows path/event-loop changes; no new actionable findings.
Hosted checks completed: 19 passed, 2 skipped, including both Windows test versions and the Windows packaged-contract check. No candidate code or local tests were executed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bb7c8130a
ℹ️ 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".
There was a problem hiding this comment.
Superseded by request changes: confirmed AnyLLM native Responses capture-policy gap.
Approved the updated commit after two independent static reviews. Reviewed the merge-sensitive integration with the tool preparation/output hooks, approval and cancellation span lifetimes, and the shared input/configuration/tool-definition capture budget. Capture remains opt-in with the sensitive-data veto respected, and the added regressions check that tracing does not change model requests. No actionable findings.
Hosted checks: 2 skipped, 18 success, 6 in_progress. Static review only; no candidate code or local tests executed.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Request changes: supersedes my earlier approval at this commit. I missed the AnyLLM native Responses integration gap identified in the existing P2 finding; two independent static checks now confirm it. Both streaming and nonstreaming paths assign raw input and full provider responses to ResponseSpanData, whose fields have no capture-policy setter. With operation_detail="content", native processors can therefore receive oversized input and unfiltered reasoning/media despite the bounded-content policy. OpenTelemetry sanitization does not protect native processors. Route this adapter through the bounded model-capture pipeline, preserve legacy behavior when the setting is omitted, and cover both paths with native-processor regressions.
Referencing the existing finding rather than adding a duplicate inline comment. Hosted CI does not resolve this static finding. No candidate code or local tests executed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7472be41cc
ℹ️ 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".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 7472be41cc
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43091c5a0e
ℹ️ 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".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved after independent static re-reviews of the current commit. The AnyLLM Responses capture gap is fixed in both streaming and nonstreaming paths, with effective submitted requests captured through the bounded model pipeline and legacy behavior preserved. Also reviewed bounded mapping traversal, visible refusal projection, local-shell finalization, and capture policy around resumable checkpoint callbacks. No remaining actionable findings in the reviewed changes.
Hosted checks: 2 skipped, 33 success. Static review only; no candidate code or local tests executed.
Summary
Use one application-owned OpenTelemetry tracer provider to follow an agent run from the caller through its model calls and tool executions. A database call inside a Python tool becomes a child of that tool. When the worker resumes after approval, the new invocation attaches to its current caller and the tool span measures the actual execution.
Install
openai-agents[opentelemetry]and registerOpenTelemetryTracingProcessor(tracer_provider=provider). Useadd_trace_processor()for dual export orset_trace_processors()to choose OTel as the only destination. The processor maps SDK spans to GenAI operations. The application controls sampling, batching, and delivery.Choose what to capture per run through
RunConfig.tracing. Every registered processor sees the same SDK spans.operation_detail"metadata""content"trace_include_sensitive_data=Falsetakes precedence at capture. Messages, configuration, and tool definitions share the input budget. Output has a separate budget. Detailed mode groups Runner retries of the same inference, including backoff. The default keeps per-attempt callbacks for those retries. Responses calls useresponsespans by default andgenerationspans in detailed mode.Merge into
feat/simple-codexbefore #6106, which uses this processor for the embedded Codex provider. The base includes #6108, #6102, and #6103. The usage guide is in draft #6107.Test plan
extra_bodyoverrides, the full application result, the SDK span, and OTel under the default, metadata, content, and veto policies. AnyLLM findingChecks
.agents/skills/code-change-verification/scripts/run.sh.