Skip to content

fix: preserve defined W3C flags in native tracing - #2175

Merged
markstuart-oai merged 98 commits into
feat/codex-harnessfrom
codex/trace-defined-flags-follow-up
Nov 5, 2026
Merged

markstuart-oai merged 98 commits into
feat/codex-harnessfrom
codex/trace-defined-flags-follow-up

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Requirement: REQ442 — preserve defined W3C trace flags through native tracing. Builds on merged #2164. Current head: 050c68c7.

The native adapter rejected valid 02 and 03 flags. Child contexts could also lose the random-trace-ID bit when OpenTelemetry dropped a span. This change preserves that bit while each child keeps its own sampling decision and span ID.

The pinned propagator still validates the carrier. The adapter checks field widths and keeps the random bit in the existing context. Remote 00 and 01 clear the inherited bit. Unrelated traces and new roots do not inherit it.

Owned children retain their raw parent through later submissions, active steering and retained continuation. An existing SDK tracing lease takes precedence. The raw carrier carries trace ancestry without restoring private tracing policy. Existing child identity, admission and settlement checks stay authoritative.

The implementation lives in @openai/agents-codex; @openai/agents delegates to it. Both packages receive a patch changeset.

Test plan

The normal Core a58aca99 development build binds all 138 native inputs and six physical products. Integrating the actual metadata squash preserves the complete twelve-file feature diff, all 530 JS build inputs and 2,620 compiled files.

Five fresh development archives contain the matching native products. Actual installed ESM and CommonJS consumers each qualify 28 distinct cases, including 13 real trace subprocess modes per format. The initial four harness failures per format remain recorded; only those corrected cases were rerun. Source, archive and installed-product hashes remain unchanged. Raw-schema, post-turn answer and scoped-child controls also pass on this native composition.

Earlier owning source and Rust/Core regression results support unchanged component code. They do not qualify changed products. Current-head human and hosted code/security reviews are clean. Both required independent source reviews are clean. The complete final SDK verification passes format, lint, build, test/example types and 9,606 tests, with 116 skipped. Reviewed source, native products, archives and installed-product bindings remain unchanged before and after verification. All hosted platform checks passed, including Linux, macOS, and Windows package tests.

Issue number

REQ442; no linked GitHub issue.

Checks

  • Added regression tests and relevant documentation.
  • Added patch changesets for both packages.
  • Complete the required independent source reviews and final SDK verification.
  • Complete hosted platform checks.

markstuart-oai and others added 30 commits November 4, 2026 22:53
Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Hosted CI complete at 8f7dfba: all eight checks passed, including Linux/macOS/Windows native packages, both Node versions, coverage and Windows sandbox paths. The request-changes decision remains: raw W3C parent context is still lost through active steering/retained continuation without an SDK tracing scope. Passing CI does not address that finding. No candidate code/tests or CI reruns were executed locally.

@markstuart-oai
markstuart-oai changed the base branch from feat/codex-harness to codex/passive-request-metadata November 5, 2026 16:24

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved at aa5759c. The prior steering/retained-continuation finding is fixed: both paths prefer the receipt-owned SDK lease and fall back to the immutable raw creation carrier. Explicit absence of private policy still prevents ambient caller policy from leaking. The regression exercises steering after the last model sample and a distinct successor with the original trace ID, flags and tracestate. The W3C patch is unchanged from the reviewed version and its manifest hash matches.

Coordinator and independent static review found no actionable issues. Hosted CI: no checks reported for this head yet. CI follow-up remains open. No candidate code or tests executed locally; no CI reruns requested.

Base automatically changed from codex/passive-request-metadata to feat/codex-harness November 5, 2026 20:14

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed the incremental update from aa5759c. 72 of 73 incoming files exactly match current base e7599b9; the remaining manifest updates the inherited request-preparation checksum and result tree. Trace feature code and regressions remain unchanged. Active steering and retained continuation preserve the receipt-owned SDK lease with raw creation-carrier fallback, so the prior finding remains fixed. Both relevant patch checksums verify. Coordinator and independent static reviews found no new actionable issues. Hosted CI: 2 successful, 6 running at review. No candidate code, tests, builds, or CI reruns executed.

@markstuart-oai
markstuart-oai merged commit 2324cf3 into feat/codex-harness Nov 5, 2026
8 checks passed
@markstuart-oai
markstuart-oai deleted the codex/trace-defined-flags-follow-up branch November 5, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants