fix: server-generated message IDs to prevent client/server clock skew#11869
fix: server-generated message IDs to prevent client/server clock skew#11869KONFeature wants to merge 2 commits intoanomalyco:devfrom
Conversation
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
24bac52 to
e24ca10
Compare
|
ready to be reviewed / merged @adamdotdevin if you got some time to look at it 🙏 |
|
This matches a hang I’m seeing that I believe is caused by client/server clock skew + optimistic client-generated message IDs. Repro (web UI):
In my case, the message ordering was inverted ( A local UI workaround (associate assistant messages by |
|
We've been investigating the same root cause and took a tactical approach (fixing consumers to use array position instead of ID ordering for fork/revert/prompt-wrapping). While that eliminates the symptoms, this PR's approach of making the server authoritative for message IDs eliminates the bug class entirely. The |
What does this PR do?
messageIDis stored asclientMessageIDfor correlation onlymessage.updatedSSE event arrives with aclientMessageIDthat differs from id, the optimistic entry is updated in-place via reconcile and parts are migrated to the new IDHow did you verify your code works?
message.updatedevent arrives