Repository navigation
fix: preserve custom ID case in exported span parents - #1020
Closed
Gareth.Y (linjiaye929) wants to merge 1 commit into
Closed
Gareth.Y (linjiaye929) wants to merge 1 commit into
Gareth.Y (linjiaye929) wants to merge 1 commit into
Conversation
Gareth.Y (linjiaye929)
marked this pull request as ready for review
October 31, 2026 06:34
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve custom hexadecimal-looking span and root IDs when exporting and importing a V4 parent slug. Binary compression currently accepts uppercase/mixed-case hex strings, but decoding with
bytes.hex()lowercases them. The original parent log keeps the supplied IDs while a child created from the exported slug logs different parent/root identifiers.Only compress strings whose binary roundtrip is lossless. Noncanonical strings use the existing JSON representation; ordinary lowercase OpenTelemetry IDs keep their current compact encoding. This does not make uppercase W3C
traceparentvalues valid or change W3C parsing.Regression coverage
Seven parameterized cases use the real public logger,
span.export(),logger.start_span(parent=...), and the repository's native in-memory logging fixture. They compare the actual parent/child log records and decoded slug IDs. Cases cover uppercase span only, uppercase root only, both mixed-case, lowercase hex, decimal-only hex, arbitrary strings and uppercase UUID strings.The tests do not call Braintrust or an LLM/provider API. Backend case handling has not been tested; the demonstrated failure is the SDK emitting inconsistent parent/child identifiers.
Validation
Python 3.14.7 and uv 0.13.4 from repository tool configuration; test dependencies from the frozen lockfile.
test_span_components.py: 29 passed.--errors-only, andgit diff --checkpass.miseitself is unavailable; its equivalentpre-commit run --all-filescommand was used with configured tool versions.nox -s test_corewas interrupted by a safety rejection reporting an attempted request to api.braintrust.ai. It did not complete and is not a pass. No retry was made. The run had CI replay mode and an external-socket guard, but those precautions do not override the rejection.AI assistance was used for implementation and local verification. No human review or hosted-CI success is claimed.