Fix message disappearing and duplicate rendering bugs

#10
by akseljoonas HF Staff - opened
smolagents org

Fixes two related bugs in message handling:

  1. Message disappearing/reappearing: Polling was overwriting SDK streaming state with stale backend state. Now only applies poll updates when backend has more messages.

  2. Duplicate message rendering: Each poll created new message IDs, causing React to render duplicates. Now preserves existing message IDs across conversions.

Changes:

  • Add poll update guard to prevent overwriting streaming state
  • Preserve message IDs when converting backend messages to UI format
  • Pass existing UI messages to llmMessagesToUIMessages() for ID reuse
akseljoonas changed pull request status to merged

Sign up or log in to comment