chat: surface generic error messages instead of raw technical strings#54
Merged
Conversation
Chat errors arrived from the server as raw `err.message` strings and were rendered verbatim in red at the inline assistant-error site. Add a friendlyErrorMessage helper that maps any raw error to a short, non-technical line (with a few broad actionable categories: busy/network/timeout/context/auth) and apply it at both the inline error and the global banner so the two stay consistent. Raw errors are still logged server-side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chat errors arrived from the server as raw
err.messagestrings and were rendered verbatim in red at the inline assistant-error site (MessageView.tsx). This replaces those technical strings with short, generic, user-facing text.web/src/lib/error-messages.ts—friendlyErrorMessage(raw)maps any raw error to a short, non-technical line. Defaults to a single generic message and recognizes a few broad, jargon-free categories: busy/overload, network, timeout, context-window, auth.MessageView.tsx— inline error now rendersfriendlyErrorMessage(message.errorMessage)instead of the raw string. Abort handling untouched.MessageList.tsx— the global banner routeserror.messagethrough the same helper so the two render sites stay consistent.Raw errors are still logged server-side (
ws-chat.ts), so nothing diagnostic is lost — only the user-facing display is now generic.Tool/subagent error output cards are intentionally left as-is (collapsible diagnostic output, not the chat-level error surface).
Test plan
bunx tsc --noEmitpasses inweb/