feat: release 2.4.0 with original cases and automatic human review
This commit is contained in:
1 parent
baf069854b
commit
4dc2057d43
66 files changed
+1390
-206
No files matched your search
@@ -379,9 +379,13 @@ def test_flash_records_the_executors_target_semantics(mock_context):
|
||||
runner,
|
||||
"click",
|
||||
click_args,
|
||||
metadata={"target_semantics": {"target_description": "play button"}},
|
||||
metadata={
|
||||
"target_semantics": {"target_description": "play button"},
|
||||
"source": {"kind": "android", "target_id": "selected-phone", "label": "安卓屏幕"},
|
||||
},
|
||||
)
|
||||
assert click["target_description"] == "play button"
|
||||
assert click["source"]["target_id"] == "selected-phone"
|
||||
assert "target_text" not in click
|
||||
assert format_actions_clean(click) == "Tapped 'play button' (self-described) at [320, 399]"
|
||||
|
||||
|
||||
@@ -124,6 +124,11 @@ async def test_planner_knows_computer_plugins_with_mobile_primary_screen(mock_co
|
||||
content = llm.astream.call_args.args[0][1].content
|
||||
text = "\n".join(part["text"] for part in content if part["type"] == "text")
|
||||
assert text.count("电脑插件:cua-driver") == 1
|
||||
assert "规划器只使用本阶段绑定的笔记工具" in text
|
||||
assert "不表示执行器缺少这些能力" in text
|
||||
assert "实际加载与操作回执" in text
|
||||
bound_names = {tool.name for tool in llm.bind_tools.call_args.args[0]}
|
||||
assert "plugin_load" not in bound_names
|
||||
assert f"当前主设备截图({'电脑' if target == 'computer' else '安卓'})" in text
|
||||
assert "不决定其他步骤的执行平台" in text
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ def mock_mcp():
|
||||
async def test_validator_success(mock_mcp, mock_context, temp_screenshot):
|
||||
"""Test that ValidatorNode executes actions successfully."""
|
||||
decisions = json.dumps([{"action": "tap", "coordinates": [105, 205]}])
|
||||
mock_context.device.device_id = "selected-phone"
|
||||
state = DummyState(structured_decisions=decisions, latest_screenshot=temp_screenshot)
|
||||
state.initial_goal = "在真实审批表单上 Approve once,不要普通聊天代答或重复提交。"
|
||||
|
||||
@@ -142,6 +143,11 @@ async def test_validator_success(mock_mcp, mock_context, temp_screenshot):
|
||||
assert len(report["execution"]) == 1
|
||||
assert report["execution"][0]["action"] == "tap"
|
||||
assert "attempts" not in report["execution"][0]
|
||||
assert report["execution"][0]["source"] == {
|
||||
"kind": "android",
|
||||
"target_id": "selected-phone",
|
||||
"label": "安卓屏幕",
|
||||
}
|
||||
# The Operator's tap verb was translated to the canonical click tool.
|
||||
assert len(mock_mcp.calls_for("click")) == 1
|
||||
|
||||
|
||||
Reference in new issue
Block a user