fix: friendly single-line API error messages (no raw JSON dumps) - #4
Merged
Conversation
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".
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.
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): nuevoformatApiError()que extrae la razón amigable del body JSON (error/error.message/message) y trunca bodies no-JSON a 200 chars.[ERROR].Resolviendo provider...→Resolving provider...ytruncado a→truncated to(quedaron sin traducir del PR fix: unify CLI and agent output language to English #2); tests actualizados.Verificación
Ollama API error 400: model 'nomic-embed-text:latest' does not support chat