Skip to content

fix(web-ui): surface agent-level errors in chat UI#118

Merged
ShotaroKataoka merged 1 commit intoaws-samples:mainfrom
yunohito:fix/agent-error-display
May 6, 2026
Merged

fix(web-ui): surface agent-level errors in chat UI#118
ShotaroKataoka merged 1 commit intoaws-samples:mainfrom
yunohito:fix/agent-error-display

Conversation

@yunohito
Copy link
Copy Markdown
Contributor

@yunohito yunohito commented May 5, 2026

Summary

Previously, Bedrock API errors (ValidationException, throttling, timeout)
were silently swallowed by the SSE parser, leaving users with an infinite
loading spinner and no feedback.

Changes

  • strandsParser.js: Handle {"status": "error"} SSE events with
    category-specific user-friendly messages (conversation limit,
    throttling, model timeout, service unavailable, generic)
  • ChatPanel.tsx: Detect retryable vs conversation-limit errors and
    show appropriate guidance

Testing

  • Verified with a session hitting "Too much media: 101 images > 100"
  • UI now shows: "⚠️ This conversation is too long for the model to
    process. Please start a new chat to continue."

Previously, agent-level errors were silently swallowed by the SSE
parser try-catch, leaving users with an infinite loading spinner.

Changes:
- strandsParser.js: handle {"status":"error"} SSE events with
  user-friendly messages for each error category:
  - Conversation limit (Too much media / input too long)
  - Throttling (rate limit exceeded)
  - Model timeout
  - Model not ready
  - Service unavailable
  - Generic errors (show raw message with warning icon)
- ChatPanel.tsx: detect retryable vs conversation-limit errors
  in catch block and show appropriate guidance
@ShotaroKataoka ShotaroKataoka added enhancement New feature or request good first issue Good for newcomers blog:skip ブログ対象外 labels May 6, 2026
Copy link
Copy Markdown
Contributor

@ShotaroKataoka ShotaroKataoka left a comment

Choose a reason for hiding this comment

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

@yunohito
Thanks for the fix! This solves a real UX pain point — the infinite spinner was a bad experience.

A few notes for future improvement (will track as a separate issue):

  • Error classification logic is duplicated between strandsParser.js and ChatPanel.tsx — we'll consolidate into a shared utility
  • Parser ideally returns error type/code rather than UI strings, so the display layer controls messaging
  • Error concatenation to currentCompletion vs message replacement in catch — we'll unify the behavior

Merging as-is since the fix is correct and impactful. Follow-up refactoring tracked separately.

@ShotaroKataoka ShotaroKataoka merged commit f0a6a00 into aws-samples:main May 6, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blog:skip ブログ対象外 enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants