brauliogusmao stops Mike from swallowing its own errors

When the AI fails mid-answer, users now learn why instead of staring at a generic "stream error."

chat-ui

Anyone who has used an AI assistant knows the dead-end moment: the answer stops, and the screen says something useless like "error" with no clue what happened. brauliogusmao traced that failure in this fork. Previously, when the underlying AI service threw a problem, the real explanation was thrown away and replaced with a hardcoded generic message - and on top of that, the interface sometimes failed silently, showing nothing at all.

The fix digs out the actual reason and surfaces it. A second pass goes further, sorting failures into named categories - out of credits, bad credentials, rate-limited, request too long, service overloaded - so the assistant can show a human-readable message tuned to each one rather than a catch-all. The handle owner flags the matching logic as something to harden later, since it leans on the exact wording vendors use.

So what Anyone running Mike in front of real users should care: clear failure messages cut support tickets and stop "is it broken?" guesswork.

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-389.md from inside the repo you want the changes in.

⬇ Download capture-thread-389.md