Skip to content

refactor: consolidate error handling between strandsParser and ChatPanel #121

@ShotaroKataoka

Description

@ShotaroKataoka

Background

PR #118 added agent-level error display to fix the infinite spinner issue.
The implementation works correctly but has some structural improvements to make.

Tasks

  • Extract error classification into a shared utility (e.g. classifyAgentError(message))
    • Returns error type: conversation_limit | throttling | timeout | not_ready | service_unavailable | generic
    • Single source of truth for string matching logic
  • Move UI display messages out of strandsParser.js into the UI layer
    • Parser returns error type/code, ChatPanel decides display text
  • Unify error display behavior: message replacement (not concatenation to currentCompletion)
  • (Nice to have) Add error_code field to backend SSE error events to reduce reliance on string matching

Context

  • strandsParser.js: 5 error categories with emoji-prefixed messages
  • ChatPanel.tsx: 3 categories (retryable / conversation-limit / generic)
  • Current concatenation: currentCompletion + errorMessage may produce awkward output if partial response exists

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions