fix(web): guarantee unique assistant-ui thread message IDs (#706)

* fix(web): guarantee unique assistant-ui thread message IDs

Suffix duplicate kind:id pairs before ExternalStore sync; skip duplicate hub
rows in SessionChat normalization. Align outline scroll targets with the
new user-text thread id shape. Closes #704.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(web): reuse thread-id wrappers for useExternalMessageConverter cache

WeakMap stable BlockWithThreadMessageId objects keyed on reconciled block
refs so streaming appends do not invalidate assistant-ui converter caches
(PR #706 review).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
HeavyGee
2026-05-27 07:13:16 +08:00
committed by GitHub
co-authored by Cursor
parent 45cf002510
commit c1eccc0de2
6 changed files with 119 additions and 38 deletions
+3
View File
@@ -325,6 +325,9 @@ export function SessionChat(props: {
const normalized: NormalizedMessage[] = []
const seen = new Set<string>()
for (const message of visibleMessages) {
if (seen.has(message.id)) {
continue
}
seen.add(message.id)
const cached = cache.get(message.id)
if (cached && cached.source === message) {