Skip to content

fix(atif): emit real UTC step timestamps instead of local time - #59

Merged
rdasilveiracabral merged 1 commit into
mainfrom
fix-atif-timestamp-timezone
Jul 31, 2026
Merged

fix(atif): emit real UTC step timestamps instead of local time#59
rdasilveiracabral merged 1 commit into
mainfrom
fix-atif-timestamp-timezone

Conversation

@sklinglernv

Copy link
Copy Markdown
Collaborator

_iso8601_utc() formatted whatever tzinfo it was handed and appended Z unconditionally, never converting. Event timestamps arrive naive (local); the no-argument default is already UTC-aware. A single trajectory therefore mixed both and its steps were not in chronological order.

Observed on a CEST (UTC+2) host — note the hour field, all suffixed Z:

step 1 system  2026-07-30T12:09:12.935Z
step 2 user    2026-07-30T12:09:12.920Z  <- out of order
step 3 user    2026-07-30T12:09:19.219Z
step 4 agent   2026-07-30T10:09:19.220Z  <- out of order
step 5 agent   2026-07-30T10:09:12.928Z  <- out of order

Invisible when running in UTC, a silent multi-hour skew everywhere else — it breaks sorting, plotting, and correlation with OTel spans or NeMo Relay trajectories.

Change

Normalise to UTC before formatting; a naive value is interpreted as local time, matching what the event system produces.

Tests

6 new; 4 fail without the fix. Full suite 6489 passed.

🤖 Generated with Claude Code

_iso8601_utc() formatted whatever tzinfo it was handed and appended "Z"
unconditionally, never converting. Event timestamps arrive naive (local) while
the no-argument default is already UTC-aware, so a single trajectory mixed both
and its steps came out non-monotonic — off by the local UTC offset. Invisible
in UTC, a silent multi-hour skew everywhere else.

Normalise to UTC first; a naive value is interpreted as local time, matching
what the event system produces.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rdasilveiracabral
rdasilveiracabral merged commit f2831fd into main Jul 31, 2026
5 checks passed
@rdasilveiracabral
rdasilveiracabral deleted the fix-atif-timestamp-timezone branch July 31, 2026 23:16
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.

2 participants