Skip to content

Conversation

@mike1858
Copy link
Member

@mike1858 mike1858 commented Dec 7, 2025

Summary

  • Messages with identical timestamps (within the same millisecond) were getting the same globalHash
  • This caused skipDuplicates on the cloud to silently drop them during upload
  • Result: ~10% data loss ($7.29 of $73.74 in one user's case, 660 messages dropped)

Fix

Include entries.len() in the hash to ensure uniqueness even when timestamps collide:

  • User messages: {file}_{timestamp}_user_{count}
  • Assistant messages: {file}_{timestamp}_assistant_{count}
  • Token events: {file}_{timestamp}_token_{count}

Test plan

  • Verified no duplicate globalHash values after fix (was 99 duplicates, now 0)
  • Re-upload data and verify cloud totals match CLI totals

Messages with identical timestamps (within the same millisecond) were
getting the same globalHash, causing skipDuplicates to silently drop
them on upload. This resulted in ~10% data loss ($7.29 of $73.74 in
one user's case).

Fix: Include entries.len() in the hash to ensure uniqueness even when
timestamps collide.
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