sim icon indicating copy to clipboard operation
sim copied to clipboard

Fix: Handle object rendering in UI

Open Patel230 opened this issue 1 month ago • 1 comments

Summary

  • Fixes #2725 - React crashes when rendering workflow output objects
  • Adds robust utility to safely format various output types
  • Prevents UI crashes when nodes return structured objects like {text, type}

Changes

  • Created format-output.ts utility with deep object traversal
  • Updated chat components to use the new formatting utility
  • Added comprehensive unit tests
  • Handles edge cases: circular refs, nested objects, arrays, XSS protection

Test Plan

  • [x] Tested with LLM outputs returning {text: "content", type: "response"}
  • [x] Tested with nested objects and arrays
  • [x] Verified no React rendering errors
  • [x] Unit tests cover all scenarios

Patel230 avatar Jan 08 '26 10:01 Patel230