Skip to content

fix(engine): log Ollama NER failure once per request - #32

Merged
woladi merged 1 commit into
masterfrom
fix/quiet-ollama-fallback
Sep 4, 2026
Merged

woladi merged 1 commit into
masterfrom
fix/quiet-ollama-fallback

Conversation

@woladi

@woladi woladi commented Sep 4, 2026

Copy link
Copy Markdown
Owner

With Ollama unavailable, applyLlmNer wrote one stderr line per chunk — a long text is dozens of chunks, all repeating the same Connection 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_status is still reported the same way. Only the logging changed.

Tests: +2 in tests/ner-status.test.ts with stderr captured — exactly 1 line for a 120-sentence text with Ollama down, 0 lines when Ollama answers.

tsc --noEmit clean, eslint clean, full suite 379/379 green. Changeset (patch) included.

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.
@woladi
woladi merged commit 3082e63 into master Sep 4, 2026
1 check passed
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