From 759d868e3bfb20ed43abda3794b04dfa0bb7603e Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Fri, 17 Apr 2026 16:28:39 +0000 Subject: [PATCH] fix: event classifier was blocked by extraction schema validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _call_ollama validates against the document extraction schema, which doesn't match event classification output. The event classifier was checking 'if attempt.error is None' before trying its own parsing, so it never got to parse the valid event JSON — 956 consecutive failures. Now tries _parse_classification_response whenever raw_output exists, regardless of the extraction validation error. --- services/extractor/event_classifier.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/extractor/event_classifier.py b/services/extractor/event_classifier.py index 57a29b4..d240c69 100644 --- a/services/extractor/event_classifier.py +++ b/services/extractor/event_classifier.py @@ -539,7 +539,10 @@ async def classify_global_event( attempt = await ollama_client._call_ollama(prompts, json_schema) raw_output = attempt.raw_output - if attempt.error is None and raw_output: + # _call_ollama validates against the *extraction* schema, which + # doesn't match event classification output. We ignore that + # validation error and try our own parsing whenever we have output. + if raw_output: # Try to parse the response try: event = _parse_classification_response(