[codex] Fix first message timestamp edge cases#5
Merged
Conversation
armand0e
marked this pull request as ready for review
June 11, 2026 01:42
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
type: "user"events frommetadata.first_message_timestampselection.payload.timestamp/message.timestampover event envelope timestamps when both exist.Why
The automated review on #4 caught two timestamp edge cases after merge:
type: "user", but convert torole: "tool", so they should not be treated as user-message timestamps.message.timestamp; the nested timestamp is the per-message value promised by the metadata docs.Follow-up to #4.
Validation
uv run pytest tests/test_converter.py-> 34 passeduv run pytest tests/test_converter.py tests/test_loader.py tests/test_trace_readme.py-> 59 passeduv run pytest-> 344 passed, 21 skippeduv run ruff check .-> passedgit diff --check-> passeduv build-> built sdist and wheel for 0.1.3uv pip check-> all installed packages compatibleuv run python -m compileall -q src tests-> passedexamples/example_claude_code.jsonl,examples/example_codex_session.jsonl, andexamples/example_pi_session.jsonl-> passeddatasets.packaged_modules.json.Json(features=AGENT_TRACES_FEATURES)-> passed for Claude tool-result, Pi nested timestamp, and OpenClaw nested timestamp casesload_traces("cfahlgren1/openclaw-test")returnsmetadata.first_message_timestamp == "2026-02-16T23:40:43.795000Z", confirming the nested OpenClaw message timestamp wins.