fix: improve cross-device evidence, request diagnostics and prompt efficiency
This commit is contained in:
1 parent
621f30e437
commit
a66803651a
60 files changed
+3097
-160
No files matched your search
@@ -186,7 +186,11 @@ async def _process_action(
|
||||
|
||||
plugins = get_plugin_runtime(node.ctx)
|
||||
if plugins and action_name in plugins.bindings:
|
||||
operation = plugins.execute(action_name, action_item.get("args", {}), str(uuid.uuid4()))
|
||||
operation = plugins.execute(
|
||||
action_name,
|
||||
action_item.get("args", {}),
|
||||
action_item.get("tool_call_id") or str(uuid.uuid4()),
|
||||
)
|
||||
control = getattr(node.ctx, "task_control", None)
|
||||
if isinstance(control, TaskControl):
|
||||
interrupted, result = await control.run_interruptibly(
|
||||
@@ -197,6 +201,7 @@ async def _process_action(
|
||||
if interrupted:
|
||||
outcome.success = False
|
||||
outcome.error_msg = "插件操作已打断,结果不确定;继续前必须重新观察。"
|
||||
outcome.action_item.update(result=outcome.error_msg, plugin_status="uncertain")
|
||||
return outcome
|
||||
else:
|
||||
result = await operation
|
||||
@@ -449,14 +454,14 @@ async def run_validation_loop(node, state: State) -> dict:
|
||||
execution.append(outcome.action_item)
|
||||
|
||||
post_image_name = None
|
||||
plugin_action = bool(outcome.action_item.get("plugin_id"))
|
||||
plugin_action = bool(outcome.action_item.get("plugin_id")) or str(
|
||||
action_name
|
||||
).startswith("plug_")
|
||||
mixed_plugin_action = (
|
||||
plugin_action and getattr(ctx, "execution_target", "android") != "computer"
|
||||
)
|
||||
if (
|
||||
plugin_action
|
||||
and not mixed_plugin_action
|
||||
and not outcome.action_item.get("pre_image_valid", False)
|
||||
if plugin_action and (
|
||||
mixed_plugin_action or not outcome.action_item.get("pre_image_valid", False)
|
||||
):
|
||||
# The turn began on another window/geometry. Keep that observation
|
||||
# out of the step's before/after evidence pair and archive exports.
|
||||
@@ -516,6 +521,10 @@ async def run_validation_loop(node, state: State) -> dict:
|
||||
if (last_screenshot_name and last_screenshot_name != decision_screenshot_name)
|
||||
else None
|
||||
)
|
||||
if len(execution) == 1 and (
|
||||
execution[0].get("plugin_id") or str(execution[0].get("action", "")).startswith("plug_")
|
||||
):
|
||||
distinct_post_image_name = execution[0].get("post_image_name")
|
||||
|
||||
if ctx.data_engine and step_id:
|
||||
ctx.data_engine.update_step_execution_result(
|
||||
|
||||
Reference in new issue
Block a user