fix: event classifier was blocked by extraction schema validation

_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.
This commit is contained in:
Celes Renata
2026-04-17 16:28:39 +00:00
parent 678072e96b
commit 759d868e3b
+4 -1
View File
@@ -539,7 +539,10 @@ async def classify_global_event(
attempt = await ollama_client._call_ollama(prompts, json_schema) attempt = await ollama_client._call_ollama(prompts, json_schema)
raw_output = attempt.raw_output 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 to parse the response
try: try:
event = _parse_classification_response( event = _parse_classification_response(