Skip to content

fix/delegate button disabled during subagent#99

Merged
xiami762 merged 2 commits intomainfrom
fix/delegate-button-disabled-during-subagent
Apr 13, 2026
Merged

fix/delegate button disabled during subagent#99
xiami762 merged 2 commits intomainfrom
fix/delegate-button-disabled-during-subagent

Conversation

@duguwanglong
Copy link
Copy Markdown
Contributor

fix(webui): use deep comparison for metadata in ChatMessageBubble memo

  • The previous fix used reference equality (===) to compare state.metadata,
    which is unreliable: SSE events produce a new object on every JSON.parse,
    causing unnecessary re-renders when metadata has not actually changed;
    conversely, an in-place mutation would be silently missed.

  • Switch to JSON.stringify for a stable content-based comparison. For the
    common case where metadata is undefined, JSON.stringify returns undefined
    on both sides with zero extra cost. For DelegateTaskCard parts the
    payload is small (sessionId, steps, stepCount, currentText, elapsed), so
    the serialisation overhead is negligible.

The previous fix used reference equality (===) to compare state.metadata,
which is unreliable: SSE events produce a new object on every JSON.parse,
causing unnecessary re-renders when metadata has not actually changed;
conversely, an in-place mutation would be silently missed.

Switch to JSON.stringify for a stable content-based comparison. For the
common case where metadata is undefined, JSON.stringify returns undefined
on both sides with zero extra cost. For DelegateTaskCard parts the
payload is small (sessionId, steps, stepCount, currentText, elapsed), so
the serialisation overhead is negligible.

Made-with: Cursor
@duguwanglong duguwanglong requested a review from xiami762 April 13, 2026 04:03
@xiami762 xiami762 merged commit 1a2b976 into main Apr 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants