Skip to content

Conversation

@lucaseduoli
Copy link
Collaborator

This pull request introduces comprehensive improvements to error handling and error message display across the chat frontend and backend. The main changes include a new, user-friendly error message component in the UI, consistent propagation and storage of error states in chat messages, and enhanced error detection and reporting throughout the backend and API layers. These updates result in clearer feedback for users when errors occur and ensure that error messages persist and are properly displayed in chat history.

Frontend Enhancements:

  • Error Message UI:

    • Added a new ErrorMessage React component for displaying styled error messages in chat, including support for animation and custom icons.
    • Updated ChatPage to render ErrorMessage instead of the standard assistant message when a message has an error flag. [1] [2]
    • Introduced an error property to the chat message type and ensured it is set and propagated when errors occur during chat interactions or streaming. [1] [2] [3] [4] [5] [6]
  • Streaming and Error Propagation:

    • Enhanced the chat streaming hook (useChatStreaming) to detect error states from the backend, propagate them via the error flag, and ensure error messages are immediately added to chat history and persist on refresh. [1] [2] [3] [4] [5] [6]

Backend and API Improvements:

  • Error Detection and Storage:

    • Updated the backend streaming endpoints to detect error conditions in Langflow responses, set an error flag in messages, and store these error messages in the conversation history for persistence. [1] [2] [3] [4] [5]
    • Improved conversion of Langflow messages to consistently detect and mark error messages, including heuristic detection based on content patterns.
  • Error Message Extraction and Reporting:

    • Enhanced the file ingestion service to extract and raise more informative error messages from Langflow responses, providing users with clearer feedback on failure. [1] [2] [3] [4]

These changes collectively provide a more robust and user-friendly experience when errors occur, ensuring that error states are clearly communicated, persist in chat history, and are handled consistently throughout the application.

Closes #810

Needs langflow-ai/langflow#11467

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.

[Feature]: UI Changes to display the Error Messaged from Responses API output

2 participants