Skip to content

Fix mixed timestamp timezone parsing - #35

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
Gambit-Checkmate:fix/mixed-timestamp-timezones
Sep 8, 2026
Merged

Fix mixed timestamp timezone parsing#35
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
Gambit-Checkmate:fix/mixed-timestamp-timezones

Conversation

@Gambit-Checkmate

Copy link
Copy Markdown
Contributor

What & why

A transcript mixing offset-aware and offset-naive timestamps crashes when its runs are sorted. Parse timestamps without offsets as UTC, while preserving explicit offsets, so sorting and duration subtraction use comparable datetimes independently of the local timezone. Make the missing-timestamp sort fallback UTC-aware as well.

Closes #27. Also addresses the missing-timestamp sorting crash described in #3.

Changes

  • Document the UTC assumption for timestamps without an offset.
  • Add transcript-level regressions for mixed naive/aware timestamps, explicit nonzero offsets, missing timestamps, and malformed timestamps. Three cases failed with TypeError before the fix; the explicit-offset case already passed.
  • Verify chronological ordering and a 30-second duration across different timestamp representations.

Validation

All 33 tests pass. Both modified Python files pass the format check; the new test file passes Ruff. Ruff on parse.py retains two pre-existing diagnostics (UP035 and FURB162), verified against origin/main; the previous DTZ901 diagnostic is resolved. git diff --check passes.

Checklist

  • Focused change with a clear description
  • Ran format / lint / tests (existing lint diagnostics noted above)
  • Updated docs
  • Linked related issues

@royalpinto007
royalpinto007 merged commit ee7e739 into AgentPostmortem:main Sep 8, 2026
8 checks passed
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Merged. Thanks a lot, @Gambit-Checkmate.

Agentrace gets better every time someone outside the repo digs in like this.

If you find Agentrace useful, consider dropping a star. It helps more people find it.

Happy to see more from you whenever you have the time.

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.

Mixed tz-aware/tz-naive transcript timestamps crash the session sort

2 participants