brauliogusmao makes chat failures explain themselves

Instead of a stalled assistant reply that simply disappears, this fork tells the user what went wrong and what to try next.

chat-uiintegration

The change targets a familiar trust-killer in AI legal tools: a chat response fails halfway through, but the screen offers no useful explanation. brauliogusmao now carries the provider's error through to the conversation rather than letting it vanish.

Common failures are turned into clearer, Portuguese-language guidance, with the original message retained when the system cannot recognise the problem. That should make it easier for a user to distinguish a temporary provider issue from a problem with their request, and decide whether to retry or escalate.

The error matching is still based on provider wording, so it may need attention if those services change how they describe failures.

So what Teams relying on chat for legal research or drafting should care because visible failures are easier to recover from and less likely to be mistaken for unreliable AI.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from brauliogusmao/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
ed833e17 fix: exibe mensagem de erro da API no balão do chat Braulio Gabriel Gusmao 2026-05-12 ↗ GitHub
commit body
Antes o backend enviava "Stream error" genérico e o frontend
ignorava o evento silenciosamente - o usuário via apenas o
spinner desaparecer sem explicação.

Backend: extrai a mensagem real do erro (ex: "Your credit balance
is too low...") da estrutura aninhada do SDK Anthropic/OpenAI e a
envia no evento SSE { type: "error", message: "..." }.

Frontend: trata o evento type="error" lançando a mensagem como
exceção, que é capturada pelo bloco catch existente e exibida
no balão do assistente como mensagem de erro.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4896b8c3 Traduz mensagens de erro do chat para português Braulio Gabriel Gusmao 2026-05-12 ↗ GitHub
commit body
Backend emite código de erro estruturado (code + message) para erros
conhecidos (saldo insuficiente, chave inválida, rate limit, etc.).
Frontend traduz pelo código; fallback para mensagem bruta ou genérica.
Corrige também o bug em que o throw dentro do try/catch interno era
silenciado - agora usa variável streamError propagada após o loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-2021.md from inside the repo you want the changes in.

⬇ Download capture-thread-2021.md