Repository navigation
fix(engine): log Ollama NER failure once per request - #32
Merged
Merged
Conversation
With Ollama down, every chunk of a long text wrote its own identical "Connection refused" line to stderr, which the MCP client surfaces in its log. Failures are now counted and reported in a single summary line with the first error. Fallback behaviour and ner_status are unchanged.
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.
With Ollama unavailable,
applyLlmNerwrote one stderr line per chunk — a long text is dozens of chunks, all repeating the sameConnection refused, and the MCP client surfaces every one of them in its log.Fix: count the failed chunks and emit a single summary line per request:
Ollama NER skipped N/M chunk(s): <first error>.Fallback behaviour is unchanged — regex still runs,
ner_statusis still reported the same way. Only the logging changed.Tests: +2 in
tests/ner-status.test.tswith stderr captured — exactly 1 line for a 120-sentence text with Ollama down, 0 lines when Ollama answers.tsc --noEmitclean,eslintclean, full suite 379/379 green. Changeset (patch) included.