fix: ask Ollama for JSON instead of only checking whether we got any
"Response Format: JSON object" parsed the reply and failed the attempt when it
did not parse - but the model was never told. The request carried model,
messages, stream and temperature and nothing else, so nothing stopped an
almost-JSON reply being generated.
One eventually was. A missing opening quote:
{ "title_hu":Tuzfenyes ejszakai olelkezes", "title_en": "Firelit Night ...
failed all three attempts and took the workflow down with it - at temperature
0.4, over a long bilingual answer, which is where the odds catch up.
The node now sends Ollama's format parameter when JSON is asked for, so
decoding is constrained and a malformed reply cannot be produced. What is left
for the parse below to handle is an empty or truncated response, not a mangled
one.
This was a one-node gap: every OpenAI-compatible sibling already sends
response_format. Ollama's native API names the parameter differently, and it
was the one that got missed.
Verified against the setup that failed - glm-5.2:cloud on https://ollama.com,
same credential and temperature, retries disabled so each run was a single
attempt: 4/4 valid JSON with all four expected keys.
Node suite: 90 passed, 0 failed, 2 skipped (both sd.cpp cases needing a model
loaded on that server, which is not loaded here).