fix(web): dedupe optimistic user message against snapshot resync - #1620
Conversation
🦋 Changeset detectedLatest commit: d0388de The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
85ae548 to
5eb3a15
Compare
💡 Codex Reviewkimi-code/apps/kimi-web/src/api/daemon/agentEventProjector.ts Lines 733 to 734 in 85ae548 This reset assumes every backend stamps ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
commit: |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
No linked issue — the problem is explained below.
Problem
In kimi-web, a snapshot resync can occasionally leave an optimistic user message next to the snapshot's authoritative copy. The optimistic bubble deliberately keeps its client-side
msg_opt_*id to avoid remounting, while the v2 submit result stamps the authoritative user-message id intopromptId.mergeSnapshotMessagespreviously only usedcreatedAtto decide which loaded messages fell before the snapshot window, so it did not use the stable identity already available.What changed
promptIdmatches one of those ids. This follows the v2 identity contract whereprompt_idanduser_message_idare the same value.promptId, while the snapshot message carries it inidand omitspromptId.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.