feat: add Android task file evidence and finalize plugin design

This commit is contained in:
chenmingxuan committed 2026-10-15 18:27:11 +08:00
1 parent 96fedc816f
commit 72ff342605
20 files changed
+1005 -35

No files matched your search

+13 -3
View File
@@ -91,6 +91,7 @@ from artemis.services.llm import (
invoke_llm_with_timeout_message,
)
from artemis.tools.history import history_tool_declarations
from artemis.tools.android_files import android_file
from artemis.tools.tool_wrapper import tool_result_messages
from artemis.utils.coordinates import (
COORDINATE_SPACE_KEY,
@@ -212,6 +213,8 @@ class FlashRunner:
# declared from the very same args schemas the LangChain tools bind
# (same availability gates: a DataEngine session, recall config).
tools.extend(history_tool_declarations(self.ctx))
if android_file.is_available(self.ctx):
tools.append(android_file.to_tool_declaration())
if self._video_tools_enabled():
from artemis.tools.video_tool import VIDEO_ANALYZER_TOOL
@@ -631,7 +634,9 @@ class FlashRunner:
and getattr(self.ctx, "execution_target", "android") != "computer"
):
return post_img_bytes
if post_img_bytes or name not in action_names:
# File operations have their own verified receipts. Do not add a UI
# observation/visual summary that could obscure that non-visual evidence.
if post_img_bytes or name not in action_names or name == "android_file":
return post_img_bytes
if state is not None:
state.indexed_points = []
@@ -733,6 +738,9 @@ class FlashRunner:
)
action_dict.pop("coordinates", None)
action_dict.pop(COORDINATE_SPACE_KEY, None)
if name == "android_file":
action_dict.pop("coordinates", None)
action_dict.pop(COORDINATE_SPACE_KEY, None)
return action_dict
def _record_action_step(
@@ -827,7 +835,9 @@ class FlashRunner:
"""
# Dynamic dispatch set: manifest device actions plus any backend
# extension tools, so extension steps are recorded like actions.
action_names = self.executor.action_tool_names
# File helpers perform real work too. Persist their receipts as steps,
# otherwise helper-only turns vanish from the final checker's evidence.
action_names = self.executor.action_tool_names | {"android_file"}
plugin_action = False
try:
operation = self.executor.execute(
@@ -1017,7 +1027,7 @@ class FlashRunner:
Returns (final_report, pre_screenshot_bytes, xml_list, action_sequence);
final_report is non-None only when 'report_task_status' was called.
"""
action_names = self.executor.action_tool_names
action_names = self.executor.action_tool_names | {"android_file"}
index_elements = self._turn_index_snapshot(state)
for tc in tool_calls:
control = getattr(self.ctx, "task_control", None)