Problem
When using cloud reasoning models (e.g. step-3.7-flash) via Chat Completions API, the parser fails on the first step:
ValueError: ui_action must contain 'action' or 'action_type'. Got keys: ['cot']
Root Cause
ask_llm_v2.py detects reasoning_content in the API response and wraps it as a <think> block, prepending it to the model's content:
result = "<think>" + reasoning + "</think>" + "\n" + llm_content
But the model's content already contains <THINK> tags (required by the parser prompt), so the final output has two layers:
<think>reasoning_content from API</think> ← prepended by ask_llm_v2.py
<THINK>model's own thinking</THINK> ← from model content
explain:... action:CLICK point:500,300 ... ← parser needs this
The parser's str2action() uses split("</THINK>")[1] to extract key-value pairs, which grabs content after the first </THINK> — i.e., the second THINK block text, not the action parameters.
Three API Comparison
| API |
Reasoning Location |
Two-layer THINK? |
| Chat Completions |
reasoning_content field → prepended by ask_llm_v2.py |
Yes |
| Messages (Anthropic) |
thinking type block (separate) |
No |
| Responses |
reasoning type output item (separate) |
No |
The model's content always has exactly one <THINK> layer. The problem is purely in ask_llm_v2.py's handling.
Reproduction
- Configure
model_config.yaml with StepFun API:
stepfun:
api_base: "https://api.stepfun.com/v1"
api_key: "YOUR_API_KEY"
-
Set model_provider to stepfun and model_name to step-3.7-flash.
-
Run any task. First step fails with ValueError.
Fix
PR #64 — stop prepending reasoning_content in ask_llm_v2.py, return model's content as-is. Verified with real Android device.
Problem
When using cloud reasoning models (e.g.
step-3.7-flash) via Chat Completions API, the parser fails on the first step:Root Cause
ask_llm_v2.pydetectsreasoning_contentin the API response and wraps it as a<think>block, prepending it to the model'scontent:But the model's
contentalready contains<THINK>tags (required by the parser prompt), so the final output has two layers:The parser's
str2action()usessplit("</THINK>")[1]to extract key-value pairs, which grabs content after the first</THINK>— i.e., the second THINK block text, not the action parameters.Three API Comparison
reasoning_contentfield → prepended byask_llm_v2.pythinkingtype block (separate)reasoningtype output item (separate)The model's
contentalways has exactly one<THINK>layer. The problem is purely inask_llm_v2.py's handling.Reproduction
model_config.yamlwith StepFun API:Set
model_providertostepfunandmodel_nametostep-3.7-flash.Run any task. First step fails with
ValueError.Fix
PR #64 — stop prepending
reasoning_contentinask_llm_v2.py, return model'scontentas-is. Verified with real Android device.