Skip to main content

One post tagged with "identifiers"

View all tags

The conversation_id Collision That Swapped Two Users' Contexts at the Gateway

· 10 min read
Tian Pan
Software Engineer

A customer support ticket arrives that reads like a hallucination. The user attached a screenshot: a question they never asked, with their account name at the top, followed by a model response that references files they have never uploaded. The trace looks clean. The model did exactly what was asked of it. The problem is that the question came from a different tenant entirely, and your gateway routed two conversations to the same backend state because their conversation_id values collided.

You do the math on a napkin. UUID v4 has 122 bits of entropy. The birthday-bound probability of any collision in a 50-million-conversation corpus is somewhere south of one in fifty million. You ran the calculation a year ago when you designed the system. The math was correct. The math is still correct. What changed is that two of your backend tiers stopped generating IDs the same way, and the probability the math described was never the probability you were actually running on.