Repository navigation
feat: add explicit native trace context - #5508
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)
ℹ️ 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. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed the explicit trace-context API, header validation and native propagation boundaries, queued submission capture, callback span exposure, and fresh-parent manual restore. Carriers are immutable, validated before admission, and excluded from persisted checkpoint carriers; native callback correlation remains optional. No actionable findings.
Static review only; no candidate code or tests run locally. Hosted CI: checks remain pending; no failures observed.
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
e0c84b0 to
d3b8333
Compare
💡 Codex ReviewWhen this squashed commit is used for release preparation, the snapshot identifies openai-agents-python/src/agents/history.py Lines 91 to 93 in d3b8333 For this trace-context change, AGENTS.md reference: AGENTS.md:L106-L107 openai-agents-python/src/agents/session.py Lines 4821 to 4822 in d3b8333 When a caller opens a Session with AGENTS.md reference: AGENTS.md:L114-L116 ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed the response-observation and cache-write history increment. The observation implementation and main regressions match the independently reviewed response-history change. Received facts remain distinct from aggregate accounting, unknown counters stay optional, and Python repair receipts accept the signed values supported by the history codec. No JS-style nonnegative receipt mismatch exists here.
Coordinator and independent static reviews of actual old/new file contents found no actionable issue. Hosted CI on this new head remains pending; prior-head results do not qualify it. No candidate code or local tests executed.
|
Hosted CI follow-up at d3b8333: the macOS native SDK job reached 99% but hit the test step’s 10-minute limit at 22:31:35 UTC. The available log has no FAILED assertion or final pytest summary; this does not establish a new code defect. This is separate from the previously reported inherited response-history assertion failures in the Linux jobs. Approval is unchanged and CI follow-up remains open. Evidence: https://github.com/openai/openai-agents-python/actions/runs/41913204016/job/126904691205 . No local tests or reruns executed. |
|
Follow-up to #5508 (comment): Model-backed The other two findings refer to an earlier branch layout. The published The repair also incorporates #5512's corrected integrity-rejection assertion, which accepts the existing failed or cancelled settlement outcomes. The prior macOS timeout still needs a successful run on the new commit; its earlier log did not show an assertion failure. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at a3b51bd. Static re-review of the three feature-specific changed files confirms model compaction now carries the submission/session W3C trace parent through the native bridge and submit_with_trace, rather than inheriting a preceding turn override. The new regression checks overridden first turn, session-parent compaction, and subsequent ordinary turn. Existing ownership and cancellation paths are unchanged; the fourth updated file matches the base. Coordinator and independent review found no actionable issue. Hosted native CI remains pending; no candidate code or local tests ran.
7964d53 to
efa3e9a
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
a3b51bd to
259c311
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved after coordinator and independent static re-review of the updated base integration. The production tracing feature changes remain unchanged relative to the base; instruction-file and parent-trace admission compose correctly, with explicit regression coverage for validation order. No actionable findings or new feedback. Lint and documentation checks passed; current-head Linux/macOS native checks are pending. The prior-head macOS timeout is not evidence of a passing new run; CI follow-up remains open. No candidate code or local tests ran.
efa3e9a to
a776c72
Compare
259c311 to
0730558
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Re-reviewed the base integration using exact old/new trees and overlapping source. Trace ownership remains captured through queued submission, continuation, restoration, compaction, and repair; writable-root and recovery integration preserves the existing trace contract. No new findings. Hosted native CI is pending. Coordinator and independent static review; 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: 0730558ab5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Request changes for the existing P2 public-parent policy restoration finding, independently confirmed by static review. No duplicate inline finding added.
A session created with caller-supplied parent_trace and no ambient workflow/options can submit with trace_policy=None. submission_dispatch_span then installs context_from_w3c_trace_context unchanged. That parser invokes restore_policy, which looks up the trace/span IDs in the live local policy registry. A carrier naming a still-live local span therefore inherits its ScopePolicy, including the export-route credential; RoutedSpanProcessor consumes that credential when enqueuing the resulting span. This permits same-process reentry to borrow another workflow’s export policy. Public parent parsing must preserve W3C linkage without recovering local policy by caller-visible IDs; attach only policy owned by the new submission. Ensure downstream policy lookup cannot restore it either, and add a same-live-span/no-captured-policy regression test.
The new test-only distinction between the independent caller span and disabled child export is sound. The earlier explicit-parent overwrite finding remains fixed, but this newly confirmed issue supersedes my prior approval. Hosted CI remains pending. No candidate code or tests ran locally.
|
Hosted CI is complete at 5451026: 24 successful checks and 5 skipped checks, with no failures or pending checks. Linux Python 3.10–3.14, both Windows test jobs, macOS sandbox, native packages, lint/docs/type checks and CodeQL all passed. This verifies both the previously reported Linux 3.11 loop-loss failure and macOS concurrent-policy failure are resolved on this commit. Linux 3.11: https://github.com/openai/openai-agents-python/actions/runs/42038549384/job/127295053037 Static approval remains: #5508 (review) . CI follow-up is complete. No candidate code or local tests executed; no CI reruns requested. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at e94d3aa. The public-parent policy restoration finding is addressed: #5508 (comment). Public W3C carriers remain remote ancestry only, parser restoration is removed, and registry lookup rejects remote identities. Private policy/credentials are retained only through captured caller policy or opaque SDK handles. Explicit admission ownership, including no owner, prevents unrelated native spans from supplying policy; child callbacks retain creation/admission ownership.
Coordinator and two independent static reviews found no actionable regression. Reviewed added route-isolation, admission-ownership and waiter-cleanup tests; patch digest matches the series manifest. This approval supersedes my previous request-changes decision for this finding at older commits. It does not clear branches that have not incorporated this fix.
Fresh hosted CI is still running (native producers and Python/Rust CodeQL); follow-up remains open. No candidate code or local tests executed and no CI reruns requested.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at c08a715. Coordinator and independent static re-review found no actionable issue in the policy-isolation test change. Both owners must finish admission and close their caller scopes before callbacks are released, while callbacks may run serially. Both callback-policy and exported-span assertions remain intact. Setup failures are surfaced immediately, and the finally block releases, cancels and joins outstanding tasks. Production code and the previously approved public-parent security fix are unchanged.
Fresh hosted native CI is pending. This scheduling change plausibly addresses the prior macOS timeout, but a passing hosted run is still needed; prior-head failure follow-up remains open. No candidate code or local tests executed and no CI reruns requested.
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at 3e98eea. Coordinator and independent static review found no actionable issue. The test initializes sessions sequentially before concurrent submissions, separating resource setup from admission-policy capture. Session.submit captures each caller policy while retaining the shared explicit parent; callback-policy and export assertions remain intact after both caller scopes close. Owner tasks are joined before the shared exit stack closes sessions and their peers. Phase diagnostics improve any subsequent admission timeout. Production tracing/security code is unchanged.
Fresh hosted native CI is pending; the previous macOS timeout is not yet verified resolved. No candidate code or local tests executed and no CI reruns requested.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at 5451026. Static follow-up review with an independent reviewer found no actionable issues in the loop-loss regression change. The processor pump can select start before end is queued: shutdown then accounts for one failed delivery and the queued end can reach the next loop. If both records were selected, both are lost. The revised test checks the exact loss for either schedule, zero drops, cumulative partial status, no replay, and delivery of new events. Production code is unchanged from the previously reviewed commit.
Hosted CI is still running on this commit. The prior Linux 3.11 failure is addressed by this assertion correction, but a successful new run is still needed; the prior macOS timeout also remains unverified. No candidate code or local tests executed; no CI reruns requested.
Summary
Requirement: REQ442 — add native W3C parent propagation and tool-span forwarding as part of the broader tracing requirement.
Pass an incoming
TraceContextthroughparent_trace, then forwardToolContext.trace_context.to_headers()to connect another service to the calling tool span. Queued roots capture their parent. Compaction uses the Session default, and automatic continuations retain their root's parent. Restored work accepts a fresh caller parent; saved state does not restore active trace context.The supported carrier profile accepts defined trace flags
00–03. Native propagation retains the random-trace-ID bit when the local sampler drops a span. It preserves the child's span ID and sampling decision. Manual request size accounting excludes private trace metadata.Public header IDs carry ancestry only. They cannot recover SDK workflow policy or export credentials. Root and child admissions carry their own trusted SDK context separately, including an explicitly empty owner. This preserves distributed parents and workflow restrictions without registering incoming IDs or retaining per-turn policy in Session settings. The integration also preserves SessionStore durability and untraced manual-recovery call compatibility.
Test plan
54510263integrates the actualcbde5dd7v1 base. Its 110 native inputs and complete SDK Python source match release producereff6e536(Core88f56076). Later changes affect test setup, cleanup, and callback scheduling only; their focused checks pass.03, opaque local parents, and independently selected caller policy. Trusted child start, steering, and continuation retain their policy and metadata restrictions.3e98eeafwith the official Linux wheel. The current test source passes all 44 tracing/transport tests, including gRPC, on that same qualified native product. All 51 installed SDK/native files match the wheel and its RECORD. Eight Core trace-context tests and eleven SDK policy tests pass on the unchanged owning OTel source.e94d3aaasource. All 110 native inputs and the complete SDK Python source match the current head.3e98eeaf.Issue number
REQ442.
Checks
AGENTS.md, including the current full verification stack when required