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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user