From 24992fc9fb9caeaa069068b0eb63320a6a989cca Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 15 Jul 2026 12:53:50 +0800 Subject: [PATCH] fix test --- apps/device-host-agent/tests/host_agent/web/conftest.py | 9 ++++++--- .../tests/host_agent/web/test_templates.py | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/device-host-agent/tests/host_agent/web/conftest.py b/apps/device-host-agent/tests/host_agent/web/conftest.py index 3a2b2b5..1eaee7d 100644 --- a/apps/device-host-agent/tests/host_agent/web/conftest.py +++ b/apps/device-host-agent/tests/host_agent/web/conftest.py @@ -216,9 +216,12 @@ def make_task_detail_context( "index": 0, "timestamp": "2026-01-01T00:01:00Z", "prompt": "Tap the Settings icon", - "tool_call_text": '{"action": "tap", "x": 100, "y": 200}', - "result_text": '{"ok": true}', - "screenshot_src": None, + "tool_call": {"action": "tap", "x": 100, "y": 200}, + "result": {"ok": True}, + "before_screenshot_src": None, + "after_screenshot_src": None, + "ocr_results": [], + "ui_tree_nodes": [], }, ] return { diff --git a/apps/device-host-agent/tests/host_agent/web/test_templates.py b/apps/device-host-agent/tests/host_agent/web/test_templates.py index 28715bb..5be0f47 100644 --- a/apps/device-host-agent/tests/host_agent/web/test_templates.py +++ b/apps/device-host-agent/tests/host_agent/web/test_templates.py @@ -170,9 +170,12 @@ def _xss_context(template: str, session: SessionState) -> dict[str, Any]: "index": 0, "timestamp": XSS_PROBE, "prompt": XSS_PROBE, - "tool_call_text": XSS_PROBE, - "result_text": XSS_PROBE, - "screenshot_src": None, + "tool_call": {"action": XSS_PROBE, "description": XSS_PROBE}, + "result": {"ok": XSS_PROBE}, + "before_screenshot_src": None, + "after_screenshot_src": None, + "ocr_results": [], + "ui_tree_nodes": [], } ], )