Skip to content

Commit 8cd527c

Browse files
committed
prevent id collision
1 parent 8dcbb29 commit 8cd527c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ function parseBlocks(blocks: ContentBlock[]): MessageSegment[] {
179179
if (!g) {
180180
g = {
181181
type: 'agent_group',
182-
id: `agent-${key}`,
182+
// Suffix with segments.length so a later flushLanes / explicit delete
183+
// followed by re-ensure for the same key produces a fresh React key
184+
// instead of colliding with the stranded prior segment.
185+
id: `agent-${key}-${segments.length}`,
183186
agentName: name,
184187
agentLabel: resolveAgentLabel(name),
185188
items: [],

0 commit comments

Comments
 (0)