Skip to content

refactor(DATAGO-126701): Enhance error handling and messaging in PromptBuilderChat components#1275

Merged
cyrus2281 merged 10 commits intomainfrom
cyrus/DATAGO-126701/prompt
Mar 27, 2026
Merged

refactor(DATAGO-126701): Enhance error handling and messaging in PromptBuilderChat components#1275
cyrus2281 merged 10 commits intomainfrom
cyrus/DATAGO-126701/prompt

Conversation

@cyrus2281
Copy link
Copy Markdown
Collaborator

@cyrus2281 cyrus2281 commented Mar 26, 2026

What is the purpose of this change?

This change improves error handling and user experience in the prompt builder chat interface by properly identifying, displaying, and handling error states during AI interactions. It provides more robust error feedback to users instead of failing silently or crashing.

How was this change implemented?

  • Enhanced the Message interface to include an isError flag for visual indication
  • Modified ChatResponse to include error state tracking via is_error flag
  • Added visual styling for error messages with a red border and icon in PromptBuilderChat.tsx
  • Updated the backend to return structured error responses instead of throwing exceptions
  • Prevented template updates from being applied when errors occur
  • Added LLM error handling with descriptive messages in PromptBuilderAssistant.py

Key Design Decisions

This approach prioritizes graceful error handling and user feedback over simply throwing exceptions. By adding the isError flag throughout the system, we can:

  • Visually distinguish errors from normal messages
  • Continue the conversation flow even when errors occur
  • Prevent invalid data from being applied to the template
  • Provide more helpful context about what went wrong

How was this change tested?

  • Manual testing: Tested error states by triggering API failures and validating error display
  • Unit tests: Updated tests for new error handling paths
  • Integration tests: Verified end-to-end flow with error conditions
  • Known limitations: Some edge cases in complex conversational flows may need further testing

Is there anything the reviewers should focus on/be aware of?

Please review the error recovery logic and ensure we're not suppressing critical errors that should interrupt the flow.

Before

image

After

image

@cyrus2281 cyrus2281 self-assigned this Mar 26, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

✅ FOSSA Guard: Licensing (SolaceLabs_solace-agent-mesh) • PASSED

Compared against main (c2f9a451fce7eebe5a11ffd3d07c251fbb27dd03) • 0 new, 6 total (6 in base)

Scan Report | View Details in FOSSA

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

✅ FOSSA Guard: Vulnerability (SolaceLabs_solace-agent-mesh) • PASSED

Compared against main (c2f9a451fce7eebe5a11ffd3d07c251fbb27dd03) • 0 new, 3 total (3 in base)

Scan Report | View Details in FOSSA

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

WhiteSource Policy Violation Summary

✅︎ No Blocking Whitesource Policy Violations found in solaceai/solace-agent-mesh-ui-pr-1275!

…ng rendering, message sending, and error handling
Copy link
Copy Markdown
Contributor

@solace-pjones solace-pjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I just left a few comments.

@@ -174,10 +177,15 @@ async def process_message(
)
except Exception as e:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might all be dead code? It look like you can llm exceptions in the method _llm_response?

@cyrus2281 cyrus2281 enabled auto-merge (squash) March 27, 2026 19:03
@sonarqube-solacecloud
Copy link
Copy Markdown

@cyrus2281 cyrus2281 merged commit 4a355da into main Mar 27, 2026
30 checks passed
@cyrus2281 cyrus2281 deleted the cyrus/DATAGO-126701/prompt branch March 27, 2026 22:14
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