fix: Read Qwen response from 'thinking' field when 'response' is empty

Qwen 3.5 with latest Ollama returns structured thinking in separate
'thinking' field, leaving 'response' empty. Now checks both fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-06 15:07:09 +02:00
parent 1ff34227bf
commit 9f16e6d535
@@ -205,7 +205,11 @@ async def _verify_control_with_llm(
if resp.status_code != 200:
return None
raw = resp.json().get("response", "").strip()
data = resp.json()
# Qwen 3.5 may return content in 'response' or 'thinking' field
raw = data.get("response", "").strip()
if not raw:
raw = data.get("thinking", "").strip()
# Strip think tags if present
raw = re.sub(r"<think>.*?</think>", "", raw, flags=re.DOTALL).strip()