Skip to content

fix: surface conversation run errors inline in chat#711

Open
VascoSch92 wants to merge 2 commits into
mainfrom
vasco/error-msg
Open

fix: surface conversation run errors inline in chat#711
VascoSch92 wants to merge 2 commits into
mainfrom
vasco/error-msg

Conversation

@VascoSch92
Copy link
Copy Markdown
Member

@VascoSch92 VascoSch92 commented May 21, 2026

  • A human has tested these changes.

Why

The agent-server does emit the error — verified by inspecting a failed conversation's persisted events, which contained a ConversationErrorEvent (code: AuthenticationError, full detail). The gap was purely frontend display:

  • shouldRenderEvent returned false for these event kinds, so they never appeared in the transcript.
  • The error banner was only set from the live WebSocket path, never from REST-loaded history — and was fragile anyway (cleared by any subsequent non-error event and on reconnect). Since the run fails fast, by the time the user
    lands on the conversation the error is already in history → nothing shown.

Summary

Renders ConversationErrorEvent / ServerErrorEvent (e.g. the litellm AuthenticationError raised when an LLM profile has no valid API key) inline in the chat transcript, so a failed run is visible and actionable instead of dying
silently.

Addresses Bug 3 of #640: "Starting a conversation with an incorrectly configured LLM profile doesn't seem to show an error the user can act on."

Issue Number

#640

Testing

  • New tests for the renderer (icon present, detail expands, ignores non-error events) and shouldRenderEvent (both error kinds render).
  • Full conversation-events + contexts suites pass; typecheck, eslint, prettier clean.

Video/Screenshots

Screen.Recording.2026-05-21.at.17.46.07.mov

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

🐳 Docker images for this PR

GHCR package: https://github.com/OpenHands/agent-canvas/pkgs/container/agent-canvas

Component Value
Image ghcr.io/openhands/agent-canvas
Architectures amd64, arm64
Agent Server ghcr.io/openhands/agent-server:1.23.0-python
Automation openhands-automation==1.0.0a3
Commit 31c197d1c58a98df9ef2e28dc3dd1a310fb7c6f0

Pull (multi-arch manifest)

# Multi-arch manifest — Docker automatically pulls the correct architecture
docker pull ghcr.io/openhands/agent-canvas:sha-31c197d

Run

docker run -it --rm \
  -p 8000:8000 \
  ghcr.io/openhands/agent-canvas:sha-31c197d

All tags pushed for this build

ghcr.io/openhands/agent-canvas:sha-31c197d-amd64
ghcr.io/openhands/agent-canvas:vasco-error-msg-amd64
ghcr.io/openhands/agent-canvas:pr-711-amd64
ghcr.io/openhands/agent-canvas:sha-31c197d-arm64
ghcr.io/openhands/agent-canvas:vasco-error-msg-arm64
ghcr.io/openhands/agent-canvas:pr-711-arm64
ghcr.io/openhands/agent-canvas:sha-31c197d
ghcr.io/openhands/agent-canvas:vasco-error-msg
ghcr.io/openhands/agent-canvas:pr-711

About Multi-Architecture Support

  • Each tag (e.g., sha-31c197d) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., sha-31c197d-amd64) are also available if needed

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-canvas Ready Ready Preview, Comment May 21, 2026 3:52pm

Request Review

@VascoSch92 VascoSch92 requested a review from all-hands-bot May 21, 2026 15:52
Copy link
Copy Markdown
Contributor

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

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

Taste Rating: 🟢 Good taste - Elegant, simple solution

This PR fixes a real user-facing issue where conversation errors (e.g., LLM authentication failures) were not visible in the chat. The solution is sound:

  • Renders ConversationErrorEvent / ServerErrorEvent inline in the transcript
  • Removes the fragile error banner approach (which was only set from WebSocket and cleared on reconnect)
  • Works for both REST-loaded history and live events
  • Good test coverage for both the renderer and filter logic
  • No breaking changes or complexity issues

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟢 LOW

UI-only change that makes error display more robust. Simple, localized changes with good test coverage. Fixes a real bug where failed conversations appeared silent to users.

VERDICT:
Worth merging - Solves a real problem with minimal, well-tested changes.


Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/agent-canvas/actions/runs/26237093016

@VascoSch92 VascoSch92 marked this pull request as ready for review May 21, 2026 15:55
@VascoSch92 VascoSch92 requested a review from hieptl May 21, 2026 15:56
Copy link
Copy Markdown
Contributor

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

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

Taste Rating: 🟢 Good taste - Elegant, simple solution

This PR fixes a real user-facing issue where conversation errors (e.g., LLM authentication failures) were not visible in the chat. The solution is sound:

  • Renders ConversationErrorEvent / ServerErrorEvent inline in the transcript
  • Removes the fragile error banner approach (which was only set from WebSocket and cleared on reconnect)
  • Works for both REST-loaded history and live events
  • Good test coverage for both the renderer and shouldRenderEvent logic
  • Clean, low-complexity implementation following existing patterns

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟢 LOW
    UI bug fix that surfaces previously hidden error states. No breaking changes, no security concerns, well-tested.

VERDICT:
Worth merging: Fixes silent failure mode with minimal, focused changes

KEY INSIGHT:
Inline rendering of error events is more robust than banner state because it persists in the chat history regardless of how events are loaded (WebSocket vs REST) or subsequent UI state changes.


Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/agent-canvas/actions/runs/26237266232

@github-actions
Copy link
Copy Markdown
Contributor

📸 Snapshot Test Report

Warning

Snapshot comparison step crashed (timeout, OOM, or runner error) — diff results below may be incomplete or absent.
Check the CI logs for the full error output (look for the "Run snapshot comparison" step).

Warning

One or more snapshot tests crashed during generation — some snapshots below may be incomplete.
Check the CI logs for the full error output (look for the "Generate current PR snapshots" step).

✅ All snapshots match the main branch baselines.

Category Count
🔴 Changed 0
🆕 New 0
✅ Unchanged 73
Total 73
✅ Unchanged snapshots (73)

archived-conversation

  • conversation-panel-with-archived-badges
  • conversation-view-archived
  • conversation-view-sandbox-error

automations

  • automations-delete-modal
  • automations-list-active-inactive
  • automations-no-automations
  • automations-search-no-results

backends-extended

  • backend-add-blank-disabled
  • backend-add-cloud-advanced-open
  • backend-add-cloud-no-key-disabled
  • backend-add-cloud-with-key-enabled
  • backend-add-form-partially-filled
  • backend-add-invalid-url-disabled
  • backend-add-local-ready
  • backend-add-name-only-disabled
  • backend-add-two-column-layout
  • backend-add-whitespace-host-disabled
  • backend-after-switch
  • backend-cancel-nothing-saved
  • backend-dropdown-two-backends
  • backend-edit-prefilled
  • backend-manage-after-removal
  • backend-manage-two-listed
  • backend-remove-cancelled
  • backend-remove-confirmation
  • backend-switch-overlay

backends

  • backend-add-modal
  • backend-manage-modal
  • backend-selector-open

changes-tab

  • changes-deleted-file
  • changes-diff-viewer
  • changes-empty

collapsible-thinking

  • reasoning-content-collapsed
  • reasoning-content-expanded
  • think-action-collapsed
  • think-action-expanded

mcp-page

  • mcp-custom-server-1-editor-open
  • mcp-custom-server-2-url-filled
  • mcp-custom-server-3-all-filled
  • mcp-custom-server-4-installed
  • mcp-custom-server-editor
  • mcp-empty-installed
  • mcp-search-filtered
  • mcp-slack-install-1-marketplace
  • mcp-slack-install-2-modal
  • mcp-slack-install-3-filled
  • mcp-slack-install-4-installed

onboarding

  • onboarding-step-0-choose-agent
  • onboarding-step-1-check-backend
  • onboarding-step-2-setup-llm
  • onboarding-step-3-say-hello

projects-workspace-browser

  • projects-workspace-browser

settings-page

  • add-backend-modal
  • analytics-consent-modal
  • home-screen
  • settings-app-page
  • settings-page

settings-secrets

  • secrets-add-form-filled
  • secrets-add-form
  • secrets-after-save
  • secrets-delete-confirm
  • secrets-list

settings-verification

  • condenser-settings
  • verification-settings-off
  • verification-settings-on

sidebar

  • sidebar-collapsed
  • sidebar-conversation-panel
  • sidebar-filter-menu

skills-page

  • skills-empty
  • skills-loaded
  • skills-no-match
  • skills-search-filtered
  • skills-type-filter

Generated by the Snapshot Tests workflow. This comment was created by an AI agent (OpenHands) on behalf of the repo maintainers.

}

// Conversation/server error events (e.g. an LLM AuthenticationError)
if (isConversationErrorEvent(event) || isServerErrorEvent(event)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just above this, I see agent error events, those fleeting errors like LLM sending the wrong parameters for a tool call. They’re very different than conversation/server errors, in that the first aren’t even errors from the perspective of the application - the agent will just continue and do presumably better next step.

In the video though, it seems this displays the “real” errors under the name “agent error”, and I wonder if we can avoid doing that?

Copy link
Copy Markdown
Member

@enyst enyst left a comment

Choose a reason for hiding this comment

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

Thank you for this PR! This is a headache 😓

Code looks good, I do have a tiny question though: I think the video shows that we tell the user and ourselves that conversation/server errors are “agent errors”, but they are not… Confusing them has been a painful source of bugs. Could we display somehow that conversation errors are conversation errors, while agent errors are agent errors?

I sympathize with giving up the banner… on the other hand, it kinda was fulfilling the purpose to make a distinction somehow?

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.

3 participants