Skip to content

fix: friendly single-line API error messages (no raw JSON dumps) - #4

Merged
MarceloAdan73 merged 1 commit into
mainfrom
fix/error-noise-friendly-400
Aug 1, 2026
Merged

fix: friendly single-line API error messages (no raw JSON dumps)#4
MarceloAdan73 merged 1 commit into
mainfrom
fix/error-noise-friendly-400

Conversation

@MarceloAdan73

Copy link
Copy Markdown
Owner

Problema

Ollama y otros providers devuelven errores JSON (ej. {"error": "model ... does not support chat"}) que se volcaban completos en cada WARN de retry, inundando la consola de ruido.

Fix

  • aiClient.ts (x5): nuevo formatApiError() que extrae la razón amigable del body JSON (error / error.message / message) y trunca bodies no-JSON a 200 chars.
  • Generadores (x5): los WARN de retry ya no repiten el mensaje de error; la razón se muestra una sola vez en la línea final [ERROR].
  • Residuos i18n: Resolviendo provider...Resolving provider... y truncado atruncated to (quedaron sin traducir del PR fix: unify CLI and agent output language to English #2); tests actualizados.

Verificación

  • typecheck OK (6 workspaces)
  • 626 tests pasando
  • build OK
  • Smoke test caso real: Ollama 400 con modelo embedding → Ollama API error 400: model 'nomic-embed-text:latest' does not support chat

Ollama (and other providers) return JSON error bodies which were dumped
in full on every retry WARN, flooding the console with noisy output.

- aiClient (x5): new formatApiError() extracts the friendly reason from
  JSON error bodies (error / error.message / message fields) and truncates
  non-JSON bodies to 200 chars.
- Generators (x5): retry WARNs no longer repeat the full error message;
  the reason is shown once in the final [ERROR] line.
- i18n leftovers: 'Resolviendo provider...' -> 'Resolving provider...' and
  'truncado a' -> 'truncated to' now in English; tests updated.

Verified: typecheck OK (6 workspaces), 626 tests passing, build OK,
smoke test: Ollama 400 embedding model -> "Ollama API error 400: model
nomic-embed-text:latest does not support chat".
@MarceloAdan73
MarceloAdan73 merged commit 1966d41 into main Aug 1, 2026
17 checks passed
@MarceloAdan73
MarceloAdan73 deleted the fix/error-noise-friendly-400 branch August 1, 2026 21:29
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.

1 participant